From: Kevin Bowling Date: Mon, 4 Apr 2016 09:13:08 +0000 (-0700) Subject: Add FreeBSD submit_io_time to disk plugin X-Git-Tag: collectd-5.6.0~363^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=366da9526ba1b6429bf4712662babe000edad44d;p=collectd.git Add FreeBSD submit_io_time to disk plugin --- diff --git a/src/disk.c b/src/disk.c index 05a863fb..1dbdd9de 100644 --- a/src/disk.c +++ b/src/disk.c @@ -536,7 +536,7 @@ static int disk_read (void) struct gident *geom_id; const char *disk_name; - long double read_time, write_time; + long double read_time, write_time, busy_time, total_duration; for (retry = 0, dirty = 1; retry < 5 && dirty == 1; retry++) { if (snap != NULL) @@ -631,6 +631,16 @@ static int disk_read (void) disk_submit (disk_name, "disk_time", (derive_t)(read_time*1000), (derive_t)(write_time*1000)); } + if (devstat_compute_statistics(snap_iter, NULL, 1.0, + DSM_TOTAL_BUSY_TIME, &busy_time, + DSM_TOTAL_DURATION, &total_duration, + DSM_NONE) != 0) { + WARNING("%s", devstat_errbuf); + } + else + { + submit_io_time(disk_name, busy_time, total_duration); + } } geom_stats_snapshot_free(snap);