summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 00f9279)
raw | patch | inline | side by side (parent: 00f9279)
author | Pavel Rochnyack <pavel2000@ngs.ru> | |
Thu, 25 Feb 2016 14:18:15 +0000 (21:18 +0700) | ||
committer | Pavel Rochnyack <pavel2000@ngs.ru> | |
Thu, 25 Feb 2016 14:18:15 +0000 (21:18 +0700) |
src/disk.c | patch | blob | history |
diff --git a/src/disk.c b/src/disk.c
index b60fefa03bd1186aede7264bbc2d6e640ecd38e0..e3bd76186fab4a3ee6b350a3a83fb10c69e4d4a2 100644 (file)
--- a/src/disk.c
+++ b/src/disk.c
derive_t avg_read_time;
derive_t avg_write_time;
+ _Bool has_merged;
+ _Bool has_in_progress;
+ _Bool has_io_time;
+
struct diskstats *next;
} diskstats_t;
ds->read_time = read_time;
ds->write_ops = write_ops;
ds->write_time = write_time;
+
+ if (read_merged || write_merged)
+ ds->has_merged = 1;
+
+ if (in_progress)
+ ds->has_in_progress = 1;
+
+ if (io_time)
+ ds->has_io_time = 1;
+
} /* if (is_disk) */
/* Don't write to the RRDs if we've just started.. */
if (is_disk)
{
- disk_submit (output_name, "disk_merged",
+ if (ds->has_merged)
+ disk_submit (output_name, "disk_merged",
read_merged, write_merged);
- submit_in_progress (output_name, in_progress);
- submit_io_time (output_name, io_time, weighted_time);
+ if (ds->has_in_progress)
+ submit_in_progress (output_name, in_progress);
+ if (ds->has_io_time)
+ submit_io_time (output_name, io_time, weighted_time);
} /* if (is_disk) */
#if HAVE_LIBUDEV