Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CELEBORN-1007] Improve JVM metrics naming and add ThreadStates metrics
### What changes were proposed in this pull request? Since we use codahale metrics to expose JVM metrics, the name without prefix is not clear and it‘s not easy to make a grafana template for these metrics because it adds collector name or pool name in names rather than labels. So here I add jvm metric prefixes, remove pool info from name and obtain the pool name as labels if needed. And add ThreadStates metrics additionally. ### Why are the changes needed? Make jvm metrics easy to understand and get template ### Does this PR introduce _any_ user-facing change? Yes,jvm metrics naming is changed,expose threads state additionally. change examples like below: For GarbageCollectorMetricSet, G1-Old-Generation.time -> jvm.gc.time{name="G1-Old-Generation"} For MemoryUsageGaugeSet, total.init -> jvm.memory.total.init ; pools.Metaspace.usage -> jvm.memory.pools.usage{name="Metaspace"} For BufferPoolMetricSet, direct.count -> jvm.direct.count For ThreadStatesGaugeSet, add jvm.thread.count. For G1, the jvm metrics exposed now: metrics_jvm_gc_time_Value{name="G1-Old-Generation",role="Worker"} 0 1695731141588 metrics_jvm_gc_count_Value{name="G1-Young-Generation",role="Worker"} 2 1695731141588 metrics_jvm_gc_time_Value{name="G1-Young-Generation",role="Worker"} 74 1695731141588 metrics_jvm_gc_count_Value{name="G1-Old-Generation",role="Worker"} 0 1695731141588 metrics_jvm_heap_committed_Value{role="Worker"} 2109734912 1695731141588 metrics_jvm_non_heap_used_Value{role="Worker"} 47700056 1695731141588 metrics_jvm_heap_used_Value{role="Worker"} 82801184 1695731141588 metrics_jvm_total_committed_Value{role="Worker"} 2160263168 1695731141588 metrics_jvm_total_init_Value{role="Worker"} 2112290816 1695731141588 metrics_jvm_non_heap_max_Value{role="Worker"} -1 1695731141588 metrics_jvm_heap_usage_Value{role="Worker"} 0.009639326483011246 1695731141588 metrics_jvm_total_used_Value{role="Worker"} 130502480 1695731141589 metrics_jvm_heap_init_Value{role="Worker"} 2109734912 1695731141589 metrics_jvm_non_heap_committed_Value{role="Worker"} 50528256 1695731141589 metrics_jvm_non_heap_init_Value{role="Worker"} 2555904 1695731141589 metrics_jvm_non_heap_usage_Value{role="Worker"} -4.7701296E7 1695731141589 metrics_jvm_heap_max_Value{role="Worker"} 8589934592 1695731141589 metrics_jvm_total_max_Value{role="Worker"} 8589934591 1695731141589 metrics_jvm_memory_pool_used_Value{name="Code-Cache",role="Worker"} 10314368 1695731141588 metrics_jvm_memory_pool_committed_Value{name="Code-Cache",role="Worker"} 10944512 1695731141588 metrics_jvm_memory_pool_init_Value{name="G1-Eden-Space",role="Worker"} 111149056 1695731141588 metrics_jvm_memory_pool_max_Value{name="G1-Old-Gen",role="Worker"} 8589934592 1695731141588 metrics_jvm_memory_pool_used_after_gc_Value{name="G1-Survivor-Space",role="Worker"} 14680064 1695731141588 metrics_jvm_memory_pool_used_Value{name="Compressed-Class-Space",role="Worker"} 4440192 1695731141588 metrics_jvm_memory_pool_usage_Value{name="Metaspace",role="Worker"} 0.9449504192610433 1695731141588 metrics_jvm_memory_pool_max_Value{name="Metaspace",role="Worker"} -1 1695731141588 metrics_jvm_memory_pool_init_Value{name="G1-Survivor-Space",role="Worker"} 0 1695731141588 metrics_jvm_memory_pool_committed_Value{name="G1-Old-Gen",role="Worker"} 1998585856 1695731141588 metrics_jvm_memory_pool_committed_Value{name="G1-Survivor-Space",role="Worker"} 14680064 1695731141588 metrics_jvm_memory_pool_committed_Value{name="G1-Eden-Space",role="Worker"} 96468992 1695731141588 metrics_jvm_memory_pool_max_Value{name="G1-Survivor-Space",role="Worker"} -1 1695731141588 metrics_jvm_memory_pool_usage_Value{name="Compressed-Class-Space",role="Worker"} 0.004135251045227051 1695731141588 metrics_jvm_memory_pool_usage_Value{name="G1-Survivor-Space",role="Worker"} 1.0 1695731141588 metrics_jvm_memory_pool_max_Value{name="Code-Cache",role="Worker"} 251658240 1695731141588 metrics_jvm_memory_pool_init_Value{name="Compressed-Class-Space",role="Worker"} 0 1695731141589 metrics_jvm_memory_pool_usage_Value{name="G1-Eden-Space",role="Worker"} 0.34782608695652173 1695731141589 metrics_jvm_memory_pool_init_Value{name="Metaspace",role="Worker"} 0 1695731141589 metrics_jvm_memory_pool_max_Value{name="G1-Eden-Space",role="Worker"} -1 1695731141589 metrics_jvm_memory_pool_usage_Value{name="Code-Cache",role="Worker"} 0.04098917643229167 1695731141589 metrics_jvm_memory_pool_used_after_gc_Value{name="G1-Eden-Space",role="Worker"} 0 1695731141589 metrics_jvm_memory_pool_init_Value{name="Code-Cache",role="Worker"} 2555904 1695731141589 metrics_jvm_memory_pool_used_Value{name="G1-Survivor-Space",role="Worker"} 14680064 1695731141589 metrics_jvm_memory_pool_committed_Value{name="Compressed-Class-Space",role="Worker"} 4718592 1695731141589 metrics_jvm_memory_pool_used_Value{name="G1-Eden-Space",role="Worker"} 33554432 1695731141589 metrics_jvm_memory_pool_used_Value{name="G1-Old-Gen",role="Worker"} 34566688 1695731141589 metrics_jvm_memory_pool_usage_Value{name="G1-Old-Gen",role="Worker"} 0.004024092108011246 1695731141589 metrics_jvm_memory_pool_used_after_gc_Value{name="G1-Old-Gen",role="Worker"} 0 1695731141589 metrics_jvm_memory_pool_committed_Value{name="Metaspace",role="Worker"} 34865152 1695731141589 metrics_jvm_memory_pool_init_Value{name="G1-Old-Gen",role="Worker"} 1998585856 1695731141589 metrics_jvm_memory_pool_used_Value{name="Metaspace",role="Worker"} 32945840 1695731141589 metrics_jvm_memory_pool_max_Value{name="Compressed-Class-Space",role="Worker"} 1073741824 1695731141589 metrics_jvm_direct_count_Value{role="Worker"} 8 1695731141589 metrics_jvm_direct_capacity_Value{role="Worker"} 1036 1695731141589 metrics_jvm_direct_used_Value{role="Worker"} 1037 1695731141589 metrics_jvm_mapped_used_Value{role="Worker"} 0 1695731141589 metrics_jvm_mapped_capacity_Value{role="Worker"} 0 1695731141589 metrics_jvm_mapped_count_Value{role="Worker"} 0 1695731141589 metrics_jvm_thread_timed_waiting_count_Value{role="Worker"} 23 1695731141589 metrics_jvm_thread_deadlock_count_Value{role="Worker"} 0 1695731141589 metrics_jvm_thread_count_Value{role="Worker"} 78 1695731141589 metrics_jvm_thread_waiting_count_Value{role="Worker"} 45 1695731141589 metrics_jvm_thread_daemon_count_Value{role="Worker"} 75 1695731141589 metrics_jvm_thread_new_count_Value{role="Worker"} 0 1695731141589 metrics_jvm_thread_blocked_count_Value{role="Worker"} 0 1695731141590 metrics_jvm_thread_deadlocks_Value{role="Worker"} [] 1695731141590 metrics_jvm_thread_runnable_count_Value{role="Worker"} 10 1695731141590 metrics_jvm_thread_terminated_count_Value{role="Worker"} 0 1695731141590 ### How was this patch tested? UT and cluster test with g1, PS-Scavenge/PS-MarkSweep and ParNew/CMS Closes #1939 from onebox-li/improve-jvm-metrics. Authored-by: onebox-li <[email protected]> Signed-off-by: zky.zhoukeyong <[email protected]>
- Loading branch information