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