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;
}
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;
}
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);
}
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;
}
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;
}
Aggregations