digitalocean / prometheus-client-c

A Prometheus Client in C
Other
158 stars 78 forks source link

process_cpu_seconds_total do not includes utime and stime #41

Closed pavelmash closed 3 years ago

pavelmash commented 3 years ago

Current implementation of process_cpu_seconds_total gauge uses cutime + cstime so for processes without child's returns 0 Below is an output for example app metric

# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total gauge
process_cpu_seconds_total 0.000000

Can it be calculated as utime + stime + cutime + cstime to produce a valid result?