Search in sources :

Example 1 with ManagedAttribute

use of org.glassfish.gmbal.ManagedAttribute 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)

Example 2 with ManagedAttribute

use of org.glassfish.gmbal.ManagedAttribute in project Payara by payara.

the class JVMGCStatsProvider method getCollectionTime.

@ManagedAttribute(id = "collectiontime-count")
@Description("approximate accumulated collection elapsed time in milliseconds")
public CountStatistic getCollectionTime() {
    long times = -1;
    int i = 0;
    for (GarbageCollectorMXBean gcBean : gcBeanList) {
        if (gcBean.getName().equals(gcName)) {
            times = gcBean.getCollectionTime();
        }
    }
    collectionTimeCount.setCount(times);
    return collectionTimeCount;
}
Also used : GarbageCollectorMXBean(java.lang.management.GarbageCollectorMXBean) Description(org.glassfish.gmbal.Description) ManagedAttribute(org.glassfish.gmbal.ManagedAttribute)

Example 3 with ManagedAttribute

use of org.glassfish.gmbal.ManagedAttribute in project Payara by payara.

the class ConnectionQueueStatsProvider method getOpenConnectionsCount.

@ManagedAttribute(id = "countopenconnections")
@Description("The number of open/active connections")
public CountStatistic getOpenConnectionsCount() {
    final CountStatisticImpl stats = new CountStatisticImpl("CountOpenConnections", "count", "The number of open/active connections");
    stats.setCount(openConnectionsCount.size());
    return stats;
}
Also used : CountStatisticImpl(org.glassfish.external.statistics.impl.CountStatisticImpl) Description(org.glassfish.gmbal.Description) ManagedAttribute(org.glassfish.gmbal.ManagedAttribute)

Example 4 with ManagedAttribute

use of org.glassfish.gmbal.ManagedAttribute in project Payara by payara.

the class FileCacheStatsProvider method getHeapSize.

@ManagedAttribute(id = "heapsize")
@Description("Current cache size in bytes")
public CountStatistic getHeapSize() {
    final CountStatisticImpl stats = new CountStatisticImpl("HeapSize", "byte(s)", "Current cache size in bytes");
    stats.setCount(heapSize.get());
    return stats;
}
Also used : CountStatisticImpl(org.glassfish.external.statistics.impl.CountStatisticImpl) Description(org.glassfish.gmbal.Description) ManagedAttribute(org.glassfish.gmbal.ManagedAttribute)

Example 5 with ManagedAttribute

use of org.glassfish.gmbal.ManagedAttribute in project Payara by payara.

the class FileCacheStatsProvider method getMaxHeapSize.

@ManagedAttribute(id = "maxheapsize")
@Description("Maximum heap space used for cache")
public CountStatistic getMaxHeapSize() {
    final CountStatisticImpl stats = new CountStatisticImpl("MaxHeapSize", "byte(s)", "Maximum heap space used for cache");
    stats.setCount(maxHeapSize.get());
    return stats;
}
Also used : CountStatisticImpl(org.glassfish.external.statistics.impl.CountStatisticImpl) Description(org.glassfish.gmbal.Description) ManagedAttribute(org.glassfish.gmbal.ManagedAttribute)

Aggregations

ManagedAttribute (org.glassfish.gmbal.ManagedAttribute)15 Description (org.glassfish.gmbal.Description)12 CountStatisticImpl (org.glassfish.external.statistics.impl.CountStatisticImpl)11 GarbageCollectorMXBean (java.lang.management.GarbageCollectorMXBean)2 TransactionAdminBean (com.sun.enterprise.transaction.api.TransactionAdminBean)1 SQLTrace (com.sun.gjc.util.SQLTrace)1 SlowSqlTrace (fish.payara.jdbc.stats.SlowSqlTrace)1 Method (java.lang.reflect.Method)1 List (java.util.List)1 StatsProviderRegistryElement (org.glassfish.admin.monitor.StatsProviderRegistry.StatsProviderRegistryElement)1 Reset (org.glassfish.external.statistics.annotations.Reset)1 ListStatisticImpl (org.glassfish.external.statistics.impl.ListStatisticImpl)1 TreeNode (org.glassfish.flashlight.datatree.TreeNode)1