From: Florian Forster Date: Fri, 8 Dec 2017 08:39:59 +0000 (+0100) Subject: processes plugin: Use the new "delay_rate" type for Delay Accounting. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=38709eeb133299d70ecd88086fcb1b13acd6180c;p=collectd.git processes plugin: Use the new "delay_rate" type for Delay Accounting. --- diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index dab723a0..80842b12 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -6891,8 +6891,9 @@ Disabled by default. If enabled, collect Linux Delay Accounding information for matching processes. Delay Accounting provides the time processes wait for the CPU to become available, for I/O operations to finish, for pages to be swapped in and for -freed pages to be reclaimed. The metrics are reported as a percentage, e.g. -C. Disabled by default. +freed pages to be reclaimed. The metrics are reported as "seconds per second" +using the C type, e.g. C. +Disabled by default. This option is only available on Linux, requires the C library and requires the C capability at runtime. diff --git a/src/processes.c b/src/processes.c index 1fcd7a61..738a6de1 100644 --- a/src/processes.c +++ b/src/processes.c @@ -903,9 +903,9 @@ static void ps_submit_proc_list(procstat_t *ps) { plugin_dispatch_values(&vl); } - /* The ps->delay_* metrics are in nanoseconds per second. This factor converts - * them to a percentage. */ - gauge_t const delay_factor = 100.0 / 1000000000.0; + /* The ps->delay_* metrics are in nanoseconds per second. Convert to seconds + * per second. */ + gauge_t const delay_factor = 1000000000.0; struct { char *type_instance; @@ -920,7 +920,7 @@ static void ps_submit_proc_list(procstat_t *ps) { if (isnan(delay_metrics[i].rate_ns)) { continue; } - sstrncpy(vl.type, "percent", sizeof(vl.type)); + sstrncpy(vl.type, "delay_rate", sizeof(vl.type)); sstrncpy(vl.type_instance, delay_metrics[i].type_instance, sizeof(vl.type_instance)); vl.values[0].gauge = delay_metrics[i].rate_ns * delay_factor; diff --git a/src/types.db b/src/types.db index 4ca57aa7..f27ba465 100644 --- a/src/types.db +++ b/src/types.db @@ -44,6 +44,7 @@ current value:GAUGE:U:U current_connections value:GAUGE:0:U current_sessions value:GAUGE:0:U delay value:GAUGE:-1000000:1000000 +delay_rate value:GAUGE:0:U derive value:DERIVE:0:U df used:GAUGE:0:1125899906842623, free:GAUGE:0:1125899906842623 df_complex value:GAUGE:0:U