jcmd provides great diagnostic output but many commands lack a timestamp in their output.
Take below example. Two iterations of the GC.finalizer_info command but the reader has no indication of what time these samples were taken at.
****
$ jcmd 1370326 GC.finalizer_info
1370326:
Unreachable instances waiting for finalization
#instances class name
-----------------------
1734 CustomClass3
1734 CustomClass4
1733 CustomClass1
1733 CustomClass2
$ jcmd 1370326 GC.finalizer_info
1370326:
Unreachable instances waiting for finalization
#instances class name
-----------------------
879 CustomClass2
878 CustomClass1
878 CustomClass3
878 CustomClass4
****
Same situation for anyone monitoring heap info:
****
$ jcmd 1370326 GC.heap_info
1370326:
garbage-first heap total reserved 31424512K, committed 65536K, used 31414K [0x0000000082000000, 0x0000000800000000)
region size 16384K, 2 young (32768K), 1 survivors (16384K)
Metaspace used 5499K, committed 5632K, reserved 1114112K
class space used 453K, committed 512K, reserved 1048576K
****
Adding a timestamp to the output of such commands would bring value add for those debugging JVM data.
The format might be able to take similar format to Thread.print jcmd command: i.e. yyyy-MM-dd HH:mm:ss
Take below example. Two iterations of the GC.finalizer_info command but the reader has no indication of what time these samples were taken at.
****
$ jcmd 1370326 GC.finalizer_info
1370326:
Unreachable instances waiting for finalization
#instances class name
-----------------------
1734 CustomClass3
1734 CustomClass4
1733 CustomClass1
1733 CustomClass2
$ jcmd 1370326 GC.finalizer_info
1370326:
Unreachable instances waiting for finalization
#instances class name
-----------------------
879 CustomClass2
878 CustomClass1
878 CustomClass3
878 CustomClass4
****
Same situation for anyone monitoring heap info:
****
$ jcmd 1370326 GC.heap_info
1370326:
garbage-first heap total reserved 31424512K, committed 65536K, used 31414K [0x0000000082000000, 0x0000000800000000)
region size 16384K, 2 young (32768K), 1 survivors (16384K)
Metaspace used 5499K, committed 5632K, reserved 1114112K
class space used 453K, committed 512K, reserved 1048576K
****
Adding a timestamp to the output of such commands would bring value add for those debugging JVM data.
The format might be able to take similar format to Thread.print jcmd command: i.e. yyyy-MM-dd HH:mm:ss