@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; }
@ManagedAttribute(id="maxheapsize-count") @Description( "maximum amount of memory in bytes that can be used for memory management" ) public CountStatistic getMaxHeap() { maxHeap.setCount(memBean.getHeapMemoryUsage().getMax()); return maxHeap; }
@ProbeListener("glassfish:kernel:connection-queue:onTaskDequeuedEvent") public void onTaskDequeuedEvent( @ProbeParam("listenerName") String listenerName, @ProbeParam("task") String taskId) { if (name.equals(listenerName)) { countQueued.setCount(countQueuedAtomic.decrementAndGet()); } }
@ProbeListener("glassfish:kernel:connections-keep-alive:setTimeoutInSecondsEvent") public void setTimeoutInSecondsEvent( @ProbeParam("listenerName") String listenerName, @ProbeParam("timeoutInSeconds") int timeoutInSeconds) { if (name.equals(listenerName)) { this.timeoutInSeconds.setCount(timeoutInSeconds); } }
@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; }
@ManagedAttribute(id = "maxmappedmemorysize") @Description("Maximum memory map size used for caching") public CountStatistic getMaxMappedMemorySize() { final CountStatisticImpl stats = new CountStatisticImpl( "MaxMappedMemorySize", "byte(s)", "Maximum memory map size used for caching"); stats.setCount(maxMappedMemorySize.get()); return stats; }
@ManagedAttribute(id="initnonheapsize-count") @Description( "amount of memory in bytes that the Java virtual machine initially requests from the operating system for memory management" ) public CountStatistic getInitNonHeap() { initNonHeap.setCount(memBean.getNonHeapMemoryUsage().getInit()); return initNonHeap; }
@ProbeListener("glassfish:kernel:connections-keep-alive:setMaxCountRequestsEvent") public void setMaxCountRequestsEvent( @ProbeParam("listenerName") String listenerName, @ProbeParam("maxRequests") int max) { if (name.equals(listenerName)) { maxRequestsCount.setCount(max); } }
@ProbeListener("glassfish:kernel:connection-queue:onTaskDequeuedEvent") public void onTaskDequeuedEvent( @ProbeParam("listenerName") String listenerName, @ProbeParam("task") String taskId) { countQueued.setCount(countQueuedAtomic.decrementAndGet()); }
@ManagedAttribute(id="loadedclass-count") @Description( "number of classes currently loaded in the JVM" ) public CountStatistic getLoadedClassCount() { loadedClassCount.setCount(clBean.getLoadedClassCount()); return loadedClassCount; }
@ProbeListener("glassfish:kernel:thread-pool:setMaxThreadsEvent") public void setMaxThreadsEvent( @ProbeParam("monitoringId") String monitoringId, @ProbeParam("threadPoolName") String threadPoolName, @ProbeParam("maxNumberOfThreads") int maxNumberOfThreads) { if (name.equals(monitoringId)) { maxThreadsCount.setCount(maxNumberOfThreads); } }
@ProbeListener("glassfish:kernel:connection-queue:setMaxTaskQueueSizeEvent") public void setMaxTaskQueueSizeEvent( @ProbeParam("listenerName") String listenerName, @ProbeParam("size") int size) { maxQueued.setCount(size); }
@ManagedAttribute(id="currentthreadusertime") @Description( "Returns the CPU time that the current thread has executed in user mode in nanoseconds" ) public CountStatistic getCurrentThreadUserTime() { this.currentThreadUserTime.setCount(threadBean.getCurrentThreadUserTime()); return this.currentThreadUserTime; }
@ManagedAttribute(id="blockedtime") @Description( "Returns the approximate accumulated elapsed time (in milliseconds) that the thread associated with this ThreadInfo has blocked to enter or reenter a monitor since thread contention monitoring is enabled" ) public CountStatistic getBlockedTime() { blockedTime.setCount(threadInfo.getBlockedTime()); return blockedTime; }
@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; }
@ProbeListener("glassfish:kernel:thread-pool:setMaxThreadsEvent") public void setMaxThreadsEvent( @ProbeParam("monitoringId") String monitoringId, @ProbeParam("threadPoolName") String threadPoolName, @ProbeParam("maxNumberOfThreads") int maxNumberOfThreads) { maxThreadsCount.setCount(maxNumberOfThreads); }
@ManagedAttribute @Description("Total number of work items added to the queue") public synchronized CountStatistic getTotalWorkItemsAdded() { long totWorkItemsAdded = workQueue.totalWorkItemsAdded(); totalWorkItemsAdded.setCount(totWorkItemsAdded); return (CountStatistic) totalWorkItemsAdded.getStatistic(); }
@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; }
@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; }