You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
arthas/tutorials/katacoda/command-perfcounter-en/perfcounter.md

1.7 KiB

Check the current JVM Perf Counter information.

perfcounter -h{{execute T2}}

 USAGE:
   perfcounter [-d] [-h]

 SUMMARY:
   Display the perf counter infornation.

 Examples:
   perfcounter
   perfcounter -d

 WIKI:
   https://alibaba.github.io/arthas/perfcounter

 OPTIONS:
 -d, --details                        print all perf counter details
 -h, --help                           this help

Usage

perfcounter{{execute T2}}

$ perfcounter
 java.ci.totalTime                            2325637411
 java.cls.loadedClasses                       3403
 java.cls.sharedLoadedClasses                 0
 java.cls.sharedUnloadedClasses               0
 java.cls.unloadedClasses                     0
 java.property.java.version                   11.0.4
 java.property.java.vm.info                   mixed mode
 java.property.java.vm.name                   OpenJDK 64-Bit Server VM

Print more information with the -d option:

perfcounter -d{{execute T2}}

$ perfcounter -d
 Name                                   Variability   Units        Value
---------------------------------------------------------------------------------
 java.ci.totalTime                      Monotonic     Ticks        3242526906
 java.cls.loadedClasses                 Monotonic     Events       3404
 java.cls.sharedLoadedClasses           Monotonic     Events       0
 java.cls.sharedUnloadedClasses         Monotonic     Events       0
 java.cls.unloadedClasses               Monotonic     Events       0

PS: for JVM above JDK9

If the information is not printed, when the application starts, add the following parameters:

--add-opens java.base/jdk.internal.perf=ALL-UNNAMED --add-exports java.base/jdk.internal.perf=ALL-UNNAMED