From 1b462dc4aaa6a45b6ce62b58f933b23c93c1743e Mon Sep 17 00:00:00 2001 From: Pavel Rochnyack Date: Mon, 13 May 2019 02:59:23 +0700 Subject: [PATCH] virt plugin: do not report empty metrics --- src/virt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/virt.c b/src/virt.c index ff708642..2385f366 100644 --- a/src/virt.c +++ b/src/virt.c @@ -69,9 +69,9 @@ #endif /* - virConnectListAllDomains() appeared in 0.10.2 - Note that LIBVIR_CHECK_VERSION appeared a year later, so - in some systems which actually have virConnectListAllDomains() + virConnectListAllDomains() appeared in 0.10.2 (Sep 2012) + Note that LIBVIR_CHECK_VERSION appeared a year later (Dec 2013, libvirt-1.2.0), + so in some systems which actually have virConnectListAllDomains() we can't detect this. */ #if LIBVIR_CHECK_VERSION(0, 10, 2) @@ -1723,7 +1723,7 @@ static int get_memory_stats(virDomainPtr domain) { submit(domain, "swap_io", "out", &(value_t){.gauge = swap_out}, 1); } - if (min_flt > -1 || maj_flt > -1) { + if (min_flt > 0 || maj_flt > 0) { value_t values[] = { {.gauge = (gauge_t)min_flt}, {.gauge = (gauge_t)maj_flt}, }; -- 2.11.0