summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 41f4ec0)
raw | patch | inline | side by side (parent: 41f4ec0)
author | Francesco Romani <fromani@redhat.com> | |
Mon, 9 Jan 2017 10:28:10 +0000 (11:28 +0100) | ||
committer | Francesco Romani <fromani@redhat.com> | |
Mon, 13 Feb 2017 14:06:13 +0000 (15:06 +0100) |
Now that we switched to virDomainBLockStatsFlags, we can
report the `flush` stats.
Signed-off-by: Francesco Romani <fromani@redhat.com>
report the `flush` stats.
Signed-off-by: Francesco Romani <fromani@redhat.com>
src/virt.c | patch | blob | history |
diff --git a/src/virt.c b/src/virt.c
index ee51bb50a45d7502198ab9bfff437dc13af1beb5..acdc11fac88129f6a6a20e01fb23534d718131a3 100644 (file)
--- a/src/virt.c
+++ b/src/virt.c
static void disk_submit(struct lv_block_info *binfo, virDomainPtr dom,
const char *type_instance) {
+ char flush_type_instance[DATA_MAX_NAME_LEN];
+
+ ssnprintf(flush_type_instance, sizeof(flush_type_instance), "flush-%s",
+ type_instance);
+
if ((binfo->bi.rd_req != -1) && (binfo->bi.wr_req != -1))
submit_derive2("disk_ops", (derive_t)binfo->bi.rd_req,
(derive_t)binfo->bi.wr_req, dom, type_instance);
if ((binfo->rd_total_times != -1) && (binfo->wr_total_times != -1))
submit_derive2("disk_time", (derive_t)binfo->rd_total_times,
(derive_t)binfo->wr_total_times, dom, type_instance);
+
+ if (binfo->fl_req != -1)
+ submit(dom, "total_requests", flush_type_instance,
+ &(value_t){.derive = (derive_t)binfo->fl_req}, 1);
+ if (binfo->fl_total_times != -1) {
+ derive_t value = binfo->fl_total_times / 1000; // ns -> ms
+ submit(dom, "total_time_in_ms", flush_type_instance,
+ &(value_t){.derive = value}, 1);
+ }
}
static int lv_config(const char *key, const char *value) {