status-im / nim-metrics

Nim metrics client library supporting the Prometheus monitoring toolkit, StatsD and Carbon
Other
40 stars 6 forks source link

per-thread GC metrics #41

Closed stefantalpalaru closed 2 years ago

stefantalpalaru commented 2 years ago

Those two GC metrics that show thread-specific data got a "thread_id" label and an updateThreadMetrics() proc, extracted from updateSystemMetrics() so it can be called in multiple threads.

I also added a new metric - nim_gc_heap_instance_occupied_summed_bytes - which sums up all the sizes we get from dumpHeapInstances(), but it turns out to be smaller than nim_gc_mem_occupied_bytes in the main thread:

$ curl -sS http://127.0.0.1:8008/metrics | grep nim_gc | grep -Ev 'created|type_name|^#'
nim_gc_mem_bytes{thread_id="15016"} 1582231552.0
nim_gc_mem_occupied_bytes{thread_id="15016"} 676859760.0
nim_gc_heap_instance_occupied_summed_bytes 634171659.0

Do we want to keep it?