summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 061c3c0)
raw | patch | inline | side by side (parent: 061c3c0)
author | Florian Forster <octo@collectd.org> | |
Sat, 6 Sep 2014 09:47:37 +0000 (11:47 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Sat, 6 Sep 2014 09:47:37 +0000 (11:47 +0200) |
This is only supported on Linux right now.
Fixes: #705
Fixes: #705
src/disk.c | patch | blob | history | |
src/types.db | patch | blob | history |
diff --git a/src/disk.c b/src/disk.c
index cdf2816d24237025e5a649bdbb9e9890a8e676c6..e84e8355af2f802d3ce6a610ab76c45c264ad82b 100644 (file)
--- a/src/disk.c
+++ b/src/disk.c
} /* void disk_submit */
#if KERNEL_LINUX
+static void submit_in_progress (char const *disk_name, gauge_t in_progress)
+{
+ value_t v;
+ value_list_t vl = VALUE_LIST_INIT;
+
+ if (ignorelist_match (ignorelist, disk_name) != 0)
+ return;
+
+ v.gauge = in_progress;
+
+ vl.values = &v;
+ vl.values_len = 1;
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "disk", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, disk_name, sizeof (vl.plugin_instance));
+ sstrncpy (vl.type, "pending_operations", sizeof (vl.type));
+
+ plugin_dispatch_values (&vl);
+}
+
static counter_t disk_calc_time_incr (counter_t delta_time, counter_t delta_ops)
{
double interval = CDTIME_T_TO_DOUBLE (plugin_get_interval ());
derive_t write_ops = 0;
derive_t write_merged = 0;
derive_t write_time = 0;
+ gauge_t in_progress = NAN;
int is_disk = 0;
diskstats_t *ds, *pre_ds;
read_time = atoll (fields[6 + fieldshift]);
write_merged = atoll (fields[8 + fieldshift]);
write_time = atoll (fields[10+ fieldshift]);
+
+ in_progress = atof (fields[11 + fieldshift]);
}
}
else
{
disk_submit (output_name, "disk_merged",
read_merged, write_merged);
+ submit_in_progress (output_name, in_progress);
} /* if (is_disk) */
/* release udev-based alternate name, if allocated */
diff --git a/src/types.db b/src/types.db
index fcdea23ba1c3096a6042b6154311e13e9051ba40..64137b07a8bcad3b2e2c3882bad8a4a5beb5bf92 100644 (file)
--- a/src/types.db
+++ b/src/types.db
node_tx_rate value:GAUGE:0:127
objects value:GAUGE:0:U
operations value:DERIVE:0:U
+pending_operations value:GAUGE:0:U
percent value:GAUGE:0:100.1
percent_bytes value:GAUGE:0:100.1
percent_inodes value:GAUGE:0:100.1