Search in sources :

Example 11 with ManagedAttribute

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

Example 12 with ManagedAttribute

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

the class ConnectionQueueStatsProvider method getCountQueued5MinutesAverage.

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

Example 13 with ManagedAttribute

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

the class FileCacheStatsProvider method getMappedMemorySize.

@ManagedAttribute(id = "mappedmemorysize")
@Description("Size of mapped memory used for caching")
public CountStatistic getMappedMemorySize() {
    final CountStatisticImpl stats = new CountStatisticImpl("MappedMemorySize", "byte(s)", "Size of mapped memory used for caching");
    stats.setCount(mappedMemorySize.get());
    return stats;
}
Also used : CountStatisticImpl(org.glassfish.external.statistics.impl.CountStatisticImpl) Description(org.glassfish.gmbal.Description) ManagedAttribute(org.glassfish.gmbal.ManagedAttribute)

Example 14 with ManagedAttribute

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

the class StatsProviderManagerDelegateImpl method createTreeForStatsProvider.

private List<String> createTreeForStatsProvider(TreeNode parentNode, Object statsProvider) {
    /* construct monitoring tree at PluginPoint using subTreePath */
    List<String> childNodeNames = new ArrayList();
    /* Check for custom reset method and store for later to be called instead of
         standard reset methods on Statistic classes*/
    for (Method m : statsProvider.getClass().getMethods()) {
        ManagedAttribute ma = m.getAnnotation(ManagedAttribute.class);
        Reset resetMeth = m.getAnnotation(Reset.class);
        if (resetMeth != null) {
            StatsProviderRegistryElement spre = this.statsProviderRegistry.getStatsProviderRegistryElement(statsProvider);
            spre.setResetMethod(m);
        }
        if (ma != null) {
            String methodName = m.getName();
            String id = ma.id();
            if ((id == null) || id.isEmpty()) {
                // if id not specified, derive from method name
                String methodNameLower = methodName.toLowerCase(Locale.ENGLISH);
                if (methodNameLower.startsWith("get") && methodNameLower.length() > 3) {
                    id = methodNameLower.substring(3);
                }
            }
            TreeNode attrNode = TreeNodeFactory.createMethodInvoker(id, statsProvider, id, m);
            parentNode.addChild(attrNode);
            childNodeNames.add(attrNode.getName());
        }
    }
    return childNodeNames;
}
Also used : TreeNode(org.glassfish.flashlight.datatree.TreeNode) Method(java.lang.reflect.Method) Reset(org.glassfish.external.statistics.annotations.Reset) StatsProviderRegistryElement(org.glassfish.admin.monitor.StatsProviderRegistry.StatsProviderRegistryElement) ManagedAttribute(org.glassfish.gmbal.ManagedAttribute)

Example 15 with ManagedAttribute

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

the class JVMGCStatsProvider method getCollectionCount.

@ManagedAttribute(id = "collectioncount-count")
@Description("total number of collections that have occurred")
public CountStatistic getCollectionCount() {
    long counts = -1;
    for (GarbageCollectorMXBean gcBean : gcBeanList) {
        if (gcBean.getName().equals(gcName)) {
            counts = gcBean.getCollectionCount();
        }
    }
    collectionCount.setCount(counts);
    return collectionCount;
}
Also used : GarbageCollectorMXBean(java.lang.management.GarbageCollectorMXBean) 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