Search in sources :

Example 6 with CountStatisticImpl

use of org.glassfish.external.statistics.impl.CountStatisticImpl in project Payara by payara.

the class KeepAliveStatsProvider method getFlushesCount.

@ManagedAttribute(id = "countflushes")
@Description("Number of keep-alive connections that were closed")
public CountStatistic getFlushesCount() {
    final CountStatisticImpl stats = new CountStatisticImpl("CountFlushes", "count", "Number of keep-alive connections that were closed");
    stats.setCount(Math.max(0, totalKeepAliveConnectionsCount.getCount() - timeoutsCount.getCount()));
    return stats;
}
Also used : CountStatisticImpl(org.glassfish.external.statistics.impl.CountStatisticImpl) Description(org.glassfish.gmbal.Description) ManagedAttribute(org.glassfish.gmbal.ManagedAttribute)

Example 7 with CountStatisticImpl

use of org.glassfish.external.statistics.impl.CountStatisticImpl in project Payara by payara.

the class JdbcStatsProvider method getSlowSqlQueries.

@ManagedAttribute(id = "slowSqlQueries")
public ListStatistic getSlowSqlQueries() {
    // Make sure no data from previous execution is kept
    slowSqlQueries.reset();
    slowSqlQueries.clear();
    // Get slow queries and process them
    List<SlowSqlTrace> slowTraces = slowSqlTraceCache.getSlowestSqlQueries();
    for (SlowSqlTrace trace : slowTraces) {
        CountStatisticImpl stat = new CountStatisticImpl(trace.getQueryName(), StatisticImpl.UNIT_MILLISECOND, "Longest execution time");
        stat.setCount(trace.getSlowestExecutionTime());
        slowSqlQueries.add(stat);
    }
    return slowSqlQueries;
}
Also used : SlowSqlTrace(fish.payara.jdbc.stats.SlowSqlTrace) CountStatisticImpl(org.glassfish.external.statistics.impl.CountStatisticImpl) ManagedAttribute(org.glassfish.gmbal.ManagedAttribute)

Example 8 with CountStatisticImpl

use of org.glassfish.external.statistics.impl.CountStatisticImpl in project Payara by payara.

the class ThreadPoolStatsImpl method initializeStats.

private void initializeStats() throws NoSuchWorkQueueException {
    super.initialize("org.glassfish.enterprise.iiop.util.ThreadPoolStats");
    final long time = System.currentTimeMillis();
    numberOfBusyThreads = new CountStatisticImpl(threadPool.numberOfBusyThreads(), stringNumberOfBusyThreads, "COUNT", threadPool.getWorkQueue(0).toString(), time, time);
    numberOfAvailableThreads = new CountStatisticImpl(threadPool.numberOfAvailableThreads(), stringNumberOfAvailableThreads, "count", threadPool.getWorkQueue(0).toString(), time, time);
    currentNumberOfThreads = new BoundedRangeStatisticImpl(threadPool.currentNumberOfThreads(), threadPool.maximumNumberOfThreads(), threadPool.minimumNumberOfThreads(), java.lang.Long.MAX_VALUE, 0, stringCurrentNumberOfThreads, "count", threadPool.getWorkQueue(0).toString(), time, time);
    averageWorkCompletionTime = new BoundedRangeStatisticImpl(threadPool.averageWorkCompletionTime(), 0, 0, java.lang.Long.MAX_VALUE, 0, stringAverageWorkCompletionTime, "Milliseconds", threadPool.getWorkQueue(0).toString(), time, time);
    // WorkQueue workItems = threadPool.getWorkQueue(0);
    totalWorkItemsAdded = new CountStatisticImpl(workQueue.totalWorkItemsAdded(), stringTotalWorkItemsAdded, "count", workQueue.getName(), time, time);
    numberOfWorkItemsInQueue = new BoundedRangeStatisticImpl(workQueue.workItemsInQueue(), 0, 0, java.lang.Long.MAX_VALUE, 0, stringNumberOfWorkItemsInQueue, "count", workQueue.getName(), time, time);
    averageTimeInQueue = new BoundedRangeStatisticImpl(workQueue.averageTimeInQueue(), 0, 0, java.lang.Long.MAX_VALUE, 0, stringAverageTimeInQueue, "Milliseconds", workQueue.getName(), time, time);
}
Also used : BoundedRangeStatisticImpl(org.glassfish.external.statistics.impl.BoundedRangeStatisticImpl) CountStatisticImpl(org.glassfish.external.statistics.impl.CountStatisticImpl)

Example 9 with CountStatisticImpl

use of org.glassfish.external.statistics.impl.CountStatisticImpl in project Payara by payara.

the class ConnectionQueueStatsProvider method getCountQueued15MinutesAverage.

@ManagedAttribute(id = "countqueued15minutesaverage")
@Description("Average number of connections queued in the last 15 minutes")
public CountStatistic getCountQueued15MinutesAverage() {
    final CountStatisticImpl stats = new CountStatisticImpl("CountQueued15MinutesAverage", "count", "Average number of connections queued in the last 15 minutes");
    stats.setCount(getAverageBy(15));
    return stats;
}
Also used : CountStatisticImpl(org.glassfish.external.statistics.impl.CountStatisticImpl) Description(org.glassfish.gmbal.Description) ManagedAttribute(org.glassfish.gmbal.ManagedAttribute)

Example 10 with CountStatisticImpl

use of org.glassfish.external.statistics.impl.CountStatisticImpl in project Payara by payara.

the class ConnectionQueueStatsProvider method getCountQueued1MinuteAverage.

@ManagedAttribute(id = "countqueued1minuteaverage")
@Description("Average number of connections queued in the last 1 minute")
public CountStatistic getCountQueued1MinuteAverage() {
    final CountStatisticImpl stats = new CountStatisticImpl("CountQueued1MinuteAverage", "count", "Average number of connections queued in the last 1 minute");
    stats.setCount(getAverageBy(1));
    return stats;
}
Also used : CountStatisticImpl(org.glassfish.external.statistics.impl.CountStatisticImpl) Description(org.glassfish.gmbal.Description) ManagedAttribute(org.glassfish.gmbal.ManagedAttribute)

Aggregations

CountStatisticImpl (org.glassfish.external.statistics.impl.CountStatisticImpl)12 ManagedAttribute (org.glassfish.gmbal.ManagedAttribute)11 Description (org.glassfish.gmbal.Description)9 SQLTrace (com.sun.gjc.util.SQLTrace)1 SlowSqlTrace (fish.payara.jdbc.stats.SlowSqlTrace)1 BoundedRangeStatisticImpl (org.glassfish.external.statistics.impl.BoundedRangeStatisticImpl)1 ListStatisticImpl (org.glassfish.external.statistics.impl.ListStatisticImpl)1