@AMXMetadata(type="compilation-system-mon", group="monitoring") @ManagedObject @Description( "JVM Compilation Statistics" ) public class JVMCompilationStatsProvider { private CompilationMXBean compBean = ManagementFactory.getCompilationMXBean(); private StringStatisticImpl compilerName = new StringStatisticImpl("Name", "String", "Name of the Just-in-time (JIT) compiler" ); private CountStatisticImpl totalCompilationTime = new CountStatisticImpl( "TotalCompilationTime", CountStatisticImpl.UNIT_MILLISECOND, "Approximate accumlated elapsed time (in milliseconds) spent in compilation" ); @ManagedAttribute(id="name-current") @Description( "name of the Just-in-time (JIT) compiler" ) public StringStatistic getCompilerName() { compilerName.setCurrent(compBean.getName()); return compilerName; } @ManagedAttribute(id="totalcompilationtime-current") @Description( "approximate accumlated elapsed time (in milliseconds) spent in compilation" ) public CountStatistic getTotalCompilationTime() { totalCompilationTime.setCount(compBean.getTotalCompilationTime()); return totalCompilationTime; } }
@ManagedAttribute(id="threadid") @Description( "Returns the ID of the thread associated with this ThreadInfo" ) public CountStatistic getThreadId() { threadId.setCount(threadInfo.getThreadId()); return threadId; }
/** * UDP NIO Transport JMX object. * * @author Alexey Stashok */ @ManagedObject @Description("Grizzly UDP NIO Transport") public class UDPNIOTransport extends NIOTransport { public UDPNIOTransport(org.glassfish.grizzly.nio.transport.UDPNIOTransport transport) { super(transport); } @ManagedAttribute(id="socket-reuse-address") public boolean getReuseAddress() { return transport.isReuseAddress(); } @ManagedAttribute(id="client-connect-timeout-millis") public int getConnectTimeout() { return transport.getConnectionTimeout(); } }
@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="numtimerscreated") @Description( "Number of timers created in the system") public CountStatistic getNumTimersCreated() { return timerCreateStat.getStatistic(); }
@ManagedAttribute(id="totalapplicationsdeployedcount") @Description(TOTAL_APPLICATIONS_DEPLOYED_DESCRIPTION) public CountStatistic getTotalApplicationsDeployed() { return totalApplicationsDeployedCount; }
@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="uptime-count") @Description( "uptime of the Java virtual machine in milliseconds" ) public CountStatistic getUptime() { uptime.setCount(rtBean.getUptime()); return uptime; }
/** * UDP NIO Transport JMX object. * * @author Alexey Stashok */ @ManagedObject @Description("Grizzly UDP NIO Transport") public class UDPNIOTransport extends NIOTransport { public UDPNIOTransport(org.glassfish.grizzly.nio.transport.UDPNIOTransport transport) { super(transport); } @ManagedAttribute(id="socket-reuse-address") public boolean getReuseAddress() { return transport.isReuseAddress(); } @ManagedAttribute(id="client-connect-timeout-millis") public int getConnectTimeout() { return transport.getConnectionTimeout(); } }
@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="numtimersdelivered") @Description( "Number of timers delivered by the system") public CountStatistic getNumTimersDelivered() { return timerDeliveredStat.getStatistic(); } }
@ManagedAttribute(id = "maxqueued") @Description("Maximum size of the connection queue") public CountStatistic getMaxQueued() { return maxQueued; }
@ManagedAttribute(id = "currentbusythreads") @Description("Total number of busy threads") public synchronized CountStatistic getNumberOfBusyThreads() { int numBusyThreads = threadPool.numberOfBusyThreads(); numberOfBusyThreads.setCount(numBusyThreads); return (CountStatistic) numberOfBusyThreads.getStatistic(); }
@AMXMetadata(type="security-realm-mon", group="monitoring", isSingleton=false) @ManagedObject @Description( "Security Realm Statistics" ) public class RealmStatsProvider {
@ManagedAttribute(id="committednonheapsize-count") @Description( "amount of memory in bytes that is committed for the Java virtual machine to use" ) public CountStatistic getCommittedNonHeap() { committedNonHeap.setCount(memBean.getNonHeapMemoryUsage().getCommitted()); return committedNonHeap; }
/** * {@link org.glassfish.grizzly.memory.ByteBufferManager} JMX object. * * @author Alexey Stashok */ @ManagedObject @Description("Grizzly Memory Manager") public class ByteBufferManager extends MemoryManager { public ByteBufferManager(org.glassfish.grizzly.memory.ByteBufferManager memoryManager) { super(memoryManager); } @ManagedAttribute(id="is-direct") @Description("Is memory manager uses direct ByteBuffers") public boolean isDirect() { return ((org.glassfish.grizzly.memory.ByteBufferManager) memoryManager).isDirect(); } @ManagedAttribute(id="max-buffer-size") @Description("The max buffer size, which could be associated with a thread") public int getMaxThreadBufferSize() { return ((org.glassfish.grizzly.memory.ByteBufferManager) memoryManager).getMaxBufferSize(); } }
@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; }
@ManagedAttribute(id="numpassivations") @Description( "Number of passivated beans") public CountStatistic getNumPassivations() { return passivations.getStatistic(); }
@ManagedAttribute @Description("JAX-WS runtime version") public String jaxwsRuntimeVersion() { return RuntimeVersion.VERSION.toString(); }
@ManagedAttribute @Description("Total number of available threads") public synchronized CountStatistic getNumberOfAvailableThreads() { long numAvailableThreads = (long) threadPool.numberOfAvailableThreads(); numberOfAvailableThreads.setCount(numAvailableThreads); return (CountStatistic) numberOfAvailableThreads.getStatistic(); }