Skip to content

Commit

Permalink
#41 - process_cpu_seconds_total by utime + stime (#45)
Browse files Browse the repository at this point in the history
* Using utime + stime and _SC_CLK_TCK for process_cpu_seconds_total

Co-authored-by: pavel.mash <pavel.mash@inbase.com.ua>
  • Loading branch information
pavelmash and pavel.mash authored Dec 18, 2020
1 parent a9f411f commit c57034d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion prom/src/prom_collector.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ prom_map_t *prom_collector_process_collect(prom_collector_t *self) {
prom_process_stat_t *stat = prom_process_stat_new(stat_f);

// Set the metrics related to the stat file
r = prom_gauge_set(prom_process_cpu_seconds_total, ((stat->cutime + stat->cstime) / 100), NULL);
r = prom_gauge_set(prom_process_cpu_seconds_total, ((stat->utime + stat->stime) / sysconf(_SC_CLK_TCK)), NULL);
if (r) {
prom_process_limits_file_destroy(limits_f);
prom_map_destroy(limits_map);
Expand Down

0 comments on commit c57034d

Please sign in to comment.