Я пишу сценарий jython, который возвращает показатели производительности для JVMRuntimeModule. Он возвращает следующее:
HeapSize, FreeMemory, UsedMemory, UpTime, ProcessCpuUsage
, но не следующее: GCCount, GCIntervalTime, GCTime, ObjectAllocateCount, ObjectFreedCount, ThreadStartedCount, ThreadStartedCount, ObjectMountCoundCoundedCountCoundedCoveCCountWaitForLockTime
Как мне вернуть все из них?
type = sys.argv[0] # "JVM"
name = sys.argv[1] # "JVM"
process = sys.argv[2] # "MyServer"
objectName = "WebSphere:name=%s,process=%s,type=%s,*" % (name, process, type)
perfName = AdminControl.completeObjectName("type=Perf,process=%s,*" % process)
perfOName = AdminControl.makeObjectName(perfName)
sigs = ['javax.management.ObjectName', 'java.lang.Boolean']
coName = AdminControl.completeObjectName (objectName)
params = [AdminControl.makeObjectName (coName), java.lang.Boolean ('false')]
jvmObj=AdminControl.invoke_jmx (perfOName, 'getStatsObject', params, sigs)
jvmStats = jvmObj.getStatistics()
print jvmStats
jvmStats содержит только HeapSize, FreeMemory, UsedMemory, UpTime, ProcessCpuUsage
Вывод:
array([name=HeapSize, ID=1, description=The total memory (in KBytes) in the Java virtual machine run time., unit=KILOBYTE, type=BoundedRangeStatistic, lowWaterMark=262144, highWaterMark=524288, current=523264, integral=7.8067724096E10, lowerBound=262144, upperBound=524288,
name=FreeMemory, ID=2, description=The free memory (in KBytes) in the Java virtual machine run time., unit=KILOBYTE, type=CountStatistic, count=89475,
name=UsedMemory, ID=3, description=The amount of used memory (in KBytes) in the Java virtual machine run time., unit=KILOBYTE, type=CountStatistic, count=433788,
name=UpTime, ID=4, description=The amount of time (in seconds) that the Java virtual machine has been running., unit=SECOND, type=CountStatistic, count=2421377,
name=ProcessCpuUsage, ID=5, description=The CPU Usage (in percent) of the Java virtual machine., unit=N/A, type=CountStatistic, count=0], com.ibm.ws.pmi.stat.StatisticImpl)
Я бы хотел, чтобы все они были возвращены.