What is the best way to track the GC pause/stall times in a Java instance?
- can it be retrieved from the Garbage Collector GarbageCollectorMXBean?
- can it be read from gc.log?
Does gc.log have any additional information that the MXBean doesn't have? I would prefer option 1 because I want the instance to emit that metric to our monitoring system.
I have read through a few posts like this on SO, but I don't seem to be getting the right answer. I am specifically looking for the GC stall times and not the total time spent on GC.