Sun JDK 6 update 20支持的jvmstat监视器

要知道某个JVM支持的[url=http://java.sun.com/performance/jvmstat/]jvmstat[/url]监视器到底有哪些,只要用这样的脚本就行:
import java.lang.management.ManagementFactory
import sun.jvmstat.monitor.*;

name = ManagementFactory.runtimeMXBean.name
pid = name[0..<name.indexOf('@')]
vmId = new VmIdentifier(pid)
vm = MonitoredHost.getMonitoredHost(vmId).getMonitoredVm(vmId, 0)
vm.findByPattern('.*').each { println it.name }; null

当然,在不支持jvmstat API的环境里执行这脚本就只能得到异常了——这样就知道环境不支持了 :oops:

在Sun JDK 6 update 20上得到的输出是:
java.ci.totalTime
java.cls.loadedClasses
java.cls.sharedLoadedClasses
java.cls.sharedUnloadedClasses
java.cls.unloadedClasses
java.property.java.class.path
java.property.java.endorsed.dirs
java.property.java.ext.dirs
java.property.java.home
java.property.java.library.path
java.property.java.version
java.property.java.vm.info
java.property.java.vm.name
java.property.java.vm.specification.name
java.property.java.vm.specification.vendor
java.property.java.vm.specification.version
java.property.java.vm.vendor
java.property.java.vm.version
java.rt.vmArgs
java.rt.vmFlags
java.threads.daemon
java.threads.live
java.threads.livePeak
java.threads.started
sun.ci.compilerThread.0.compiles
sun.ci.compilerThread.0.method
sun.ci.compilerThread.0.time
sun.ci.compilerThread.0.type
sun.ci.lastFailedMethod
sun.ci.lastFailedType
sun.ci.lastInvalidatedMethod
sun.ci.lastInvalidatedType
sun.ci.lastMethod
sun.ci.lastSize
sun.ci.lastType
sun.ci.nmethodCodeSize
sun.ci.nmethodSize
sun.ci.osrBytes
sun.ci.osrCompiles
sun.ci.osrTime
sun.ci.standardBytes
sun.ci.standardCompiles
sun.ci.standardTime
sun.ci.threads
sun.ci.totalBailouts
sun.ci.totalCompiles
sun.ci.totalInvalidates
sun.cls.appClassBytes
sun.cls.appClassLoadCount
sun.cls.appClassLoadTime
sun.cls.appClassLoadTime.self
sun.cls.classInitTime
sun.cls.classInitTime.self
sun.cls.classLinkedTime
sun.cls.classLinkedTime.self
sun.cls.classVerifyTime
sun.cls.classVerifyTime.self
sun.cls.defineAppClassTime
sun.cls.defineAppClassTime.self
sun.cls.defineAppClasses
sun.cls.initializedClasses
sun.cls.isUnsyncloadClassSet
sun.cls.jniDefineClassNoLockCalls
sun.cls.jvmDefineClassNoLockCalls
sun.cls.jvmFindLoadedClassNoLockCalls
sun.cls.linkedClasses
sun.cls.loadInstanceClassFailRate
sun.cls.loadedBytes
sun.cls.lookupSysClassTime
sun.cls.methodBytes
sun.cls.nonSystemLoaderLockContentionRate
sun.cls.parseClassTime
sun.cls.parseClassTime.self
sun.cls.sharedClassLoadTime
sun.cls.sharedLoadedBytes
sun.cls.sharedUnloadedBytes
sun.cls.sysClassBytes
sun.cls.sysClassLoadTime
sun.cls.systemLoaderLockContentionRate
sun.cls.time
sun.cls.unloadedBytes
sun.cls.unsafeDefineClassCalls
sun.cls.verifiedClasses
sun.gc.cause
sun.gc.collector.0.invocations
sun.gc.collector.0.lastEntryTime
sun.gc.collector.0.lastExitTime
sun.gc.collector.0.name
sun.gc.collector.0.time
sun.gc.collector.1.invocations
sun.gc.collector.1.lastEntryTime
sun.gc.collector.1.lastExitTime
sun.gc.collector.1.name
sun.gc.collector.1.time
sun.gc.generation.0.agetable.bytes.00
sun.gc.generation.0.agetable.bytes.01
sun.gc.generation.0.agetable.bytes.02
sun.gc.generation.0.agetable.bytes.03
sun.gc.generation.0.agetable.bytes.04
sun.gc.generation.0.agetable.bytes.05
sun.gc.generation.0.agetable.bytes.06
sun.gc.generation.0.agetable.bytes.07
sun.gc.generation.0.agetable.bytes.08
sun.gc.generation.0.agetable.bytes.09
sun.gc.generation.0.agetable.bytes.10
sun.gc.generation.0.agetable.bytes.11
sun.gc.generation.0.agetable.bytes.12
sun.gc.generation.0.agetable.bytes.13
sun.gc.generation.0.agetable.bytes.14
sun.gc.generation.0.agetable.bytes.15
sun.gc.generation.0.agetable.size
sun.gc.generation.0.capacity
sun.gc.generation.0.maxCapacity
sun.gc.generation.0.minCapacity
sun.gc.generation.0.name
sun.gc.generation.0.space.0.capacity
sun.gc.generation.0.space.0.initCapacity
sun.gc.generation.0.space.0.maxCapacity
sun.gc.generation.0.space.0.name
sun.gc.generation.0.space.0.used
sun.gc.generation.0.space.1.capacity
sun.gc.generation.0.space.1.initCapacity
sun.gc.generation.0.space.1.maxCapacity
sun.gc.generation.0.space.1.name
sun.gc.generation.0.space.1.used
sun.gc.generation.0.space.2.capacity
sun.gc.generation.0.space.2.initCapacity
sun.gc.generation.0.space.2.maxCapacity
sun.gc.generation.0.space.2.name
sun.gc.generation.0.space.2.used
sun.gc.generation.0.spaces
sun.gc.generation.1.capacity
sun.gc.generation.1.maxCapacity
sun.gc.generation.1.minCapacity
sun.gc.generation.1.name
sun.gc.generation.1.space.0.capacity
sun.gc.generation.1.space.0.initCapacity
sun.gc.generation.1.space.0.maxCapacity
sun.gc.generation.1.space.0.name
sun.gc.generation.1.space.0.used
sun.gc.generation.1.spaces
sun.gc.generation.2.capacity
sun.gc.generation.2.maxCapacity
sun.gc.generation.2.minCapacity
sun.gc.generation.2.name
sun.gc.generation.2.space.0.capacity
sun.gc.generation.2.space.0.initCapacity
sun.gc.generation.2.space.0.maxCapacity
sun.gc.generation.2.space.0.name
sun.gc.generation.2.space.0.used
sun.gc.generation.2.spaces
sun.gc.lastCause
sun.gc.policy.collectors
sun.gc.policy.desiredSurvivorSize
sun.gc.policy.generations
sun.gc.policy.maxTenuringThreshold
sun.gc.policy.name
sun.gc.policy.tenuringThreshold
sun.gc.tlab.alloc
sun.gc.tlab.allocThreads
sun.gc.tlab.fastWaste
sun.gc.tlab.fills
sun.gc.tlab.gcWaste
sun.gc.tlab.maxFastWaste
sun.gc.tlab.maxFills
sun.gc.tlab.maxGcWaste
sun.gc.tlab.maxSlowAlloc
sun.gc.tlab.maxSlowWaste
sun.gc.tlab.slowAlloc
sun.gc.tlab.slowWaste
sun.os.hrt.frequency
sun.os.hrt.ticks
sun.perfdata.majorVersion
sun.perfdata.minorVersion
sun.perfdata.overflow
sun.perfdata.size
sun.perfdata.timestamp
sun.perfdata.used
sun.property.sun.boot.class.path
sun.property.sun.boot.library.path
sun.rt._sync_ContendedLockAttempts
sun.rt._sync_Deflations
sun.rt._sync_EmptyNotifications
sun.rt._sync_FailedSpins
sun.rt._sync_FutileWakeups
sun.rt._sync_Inflations
sun.rt._sync_MonExtant
sun.rt._sync_MonInCirculation
sun.rt._sync_MonScavenged
sun.rt._sync_Notifications
sun.rt._sync_Parks
sun.rt._sync_PrivateA
sun.rt._sync_PrivateB
sun.rt._sync_SlowEnter
sun.rt._sync_SlowExit
sun.rt._sync_SlowNotify
sun.rt._sync_SlowNotifyAll
sun.rt._sync_SuccessfulSpins
sun.rt.applicationTime
sun.rt.createVmBeginTime
sun.rt.createVmEndTime
sun.rt.internalVersion
sun.rt.interruptedBeforeIO
sun.rt.interruptedDuringIO
sun.rt.javaCommand
sun.rt.jvmCapabilities
sun.rt.jvmVersion
sun.rt.safepointSyncTime
sun.rt.safepointTime
sun.rt.safepoints
sun.rt.threadInterruptSignaled
sun.rt.vmInitDoneTime
sun.threads.vmOperationTime


如果是真的关注这些信息的人的话,上面各个监视器的内容都应该能顾名思义了 :lol:
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值