From dca674991ed7e345efa67d102de0ec1b0581503a Mon Sep 17 00:00:00 2001 From: Pavel Rochnyack Date: Thu, 25 Oct 2018 15:37:20 +0700 Subject: [PATCH] virt plugin: Submit `ps_cputime' only when data exists --- src/virt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/virt.c b/src/virt.c index 21df2d65..e7f11fc6 100644 --- a/src/virt.c +++ b/src/virt.c @@ -511,8 +511,9 @@ static int get_pcpu_stats(virDomainPtr dom) { total_syst_cpu_time = param[i].value.ul; } - submit_derive2("ps_cputime", total_user_cpu_time, total_syst_cpu_time, dom, - NULL); + if (total_user_cpu_time > 0 || total_syst_cpu_time > 0) + submit_derive2("ps_cputime", total_user_cpu_time, total_syst_cpu_time, dom, + NULL); virTypedParamsClear(param, nparams); sfree(param); -- 2.11.0