Search in sources :

Example 1 with ListStatisticImpl

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

the class JdbcStatsProvider method getfreqUsedSqlQueries.

@ManagedAttribute(id = "frequsedsqlqueries")
public ListStatistic getfreqUsedSqlQueries() {
    List<SQLTrace> sqlTraces = freqSqlTraceCache.getTopQueries();
    freqUsedSqlQueries = new ListStatisticImpl("frequsedsqlqueries", "List", "Most frequently used sql queries");
    for (SQLTrace trace : sqlTraces) {
        CountStatisticImpl stat = new CountStatisticImpl(trace.getQueryName(), "Count", "");
        stat.setCount(trace.getNumExecutions());
        freqUsedSqlQueries.add(stat);
    }
    return freqUsedSqlQueries;
}
Also used : SQLTrace(com.sun.gjc.util.SQLTrace) ListStatisticImpl(org.glassfish.external.statistics.impl.ListStatisticImpl) CountStatisticImpl(org.glassfish.external.statistics.impl.CountStatisticImpl) ManagedAttribute(org.glassfish.gmbal.ManagedAttribute)

Aggregations

SQLTrace (com.sun.gjc.util.SQLTrace)1 CountStatisticImpl (org.glassfish.external.statistics.impl.CountStatisticImpl)1 ListStatisticImpl (org.glassfish.external.statistics.impl.ListStatisticImpl)1 ManagedAttribute (org.glassfish.gmbal.ManagedAttribute)1