Closed vsmart closed 9 years ago
The first metric there is the total time spent in GC up to the current time as recorded by the JVM, so we want to simply record the value at the time the profiler emits metrics.
The second metric is the amount of time spent in GC since the last time the profiler emitted metrics. There's no particular reason to use a gauge for this one and we certainly could use a timing measure instead, but we don't have to worry about the total time since the JVM is already doing that for us and we're recording it in a different metric.
Hope that helps!
Ok, that makes sense. Thank you.
Hi, I wonder why you use a gauge for recording the GC run time, as opposed to a count or a timing measure. Does this not mean one value will be overwritten by the next measure, and the total time might be lost? https://github.com/etsy/statsd-jvm-profiler/blob/d4a138230f8eb4cf00fa85c6d5f3bc92363de430/src/main/java/com/etsy/statsd/profiler/profilers/MemoryProfiler.java#L81-L82
Any response or insight would be appreciated! Thanks!