summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4c50422)
raw | patch | inline | side by side (parent: 4c50422)
author | Michael Schenck <mschenck@digitalocean.com> | |
Tue, 7 Oct 2014 02:40:24 +0000 (22:40 -0400) | ||
committer | Michael Schenck <mschenck@digitalocean.com> | |
Tue, 7 Oct 2014 02:40:24 +0000 (22:40 -0400) |
src/disk.c | patch | blob | history | |
src/types.db | patch | blob | history |
diff --git a/src/disk.c b/src/disk.c
index e84e8355af2f802d3ce6a610ab76c45c264ad82b..9c8d1e593878fab256f433d9172b38b3de8e5329 100644 (file)
--- a/src/disk.c
+++ b/src/disk.c
plugin_dispatch_values (&vl);
}
+static void submit_io_time (char const *plugin_instance, derive_t io_time, derive_t weighted_time)
+{
+ value_t values[2];
+ value_list_t vl = VALUE_LIST_INIT;
+
+ if (ignorelist_match (ignorelist, plugin_instance) != 0)
+ return;
+
+ values[0].derive = io_time;
+ values[1].derive = weighted_time;
+
+ vl.values = values;
+ vl.values_len = 2;
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.plugin, "disk", sizeof (vl.plugin));
+ sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
+ sstrncpy (vl.type, "disk_io_time", 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_merged = 0;
derive_t write_time = 0;
gauge_t in_progress = NAN;
+ derive_t io_time = 0;
+ derive_t weighted_time = 0;
int is_disk = 0;
diskstats_t *ds, *pre_ds;
write_time = atoll (fields[10+ fieldshift]);
in_progress = atof (fields[11 + fieldshift]);
+
+ io_time = atof (fields[12 + fieldshift]);
+ weighted_time = atof (fields[13 + fieldshift]);
}
}
else
disk_submit (output_name, "disk_merged",
read_merged, write_merged);
submit_in_progress (output_name, in_progress);
+ submit_io_time (io_time, weighted_time);
} /* if (is_disk) */
/* release udev-based alternate name, if allocated */
diff --git a/src/types.db b/src/types.db
index 64137b07a8bcad3b2e2c3882bad8a4a5beb5bf92..fc75153fb79cba7ff376432908f57c6d59bbca97 100644 (file)
--- a/src/types.db
+++ b/src/types.db
disk_ops_complex value:DERIVE:0:U
disk_ops read:DERIVE:0:U, write:DERIVE:0:U
disk_time read:DERIVE:0:U, write:DERIVE:0:U
+disk_io_time io_time:DERIVE:0:U, weighted_io_time:DERIVE:0:U
dns_answer value:DERIVE:0:U
dns_notify value:DERIVE:0:U
dns_octets queries:DERIVE:0:U, responses:DERIVE:0:U