From: Pavel Rochnyack Date: Thu, 25 Oct 2018 08:37:20 +0000 (+0700) Subject: virt plugin: Submit `ps_cputime' only when data exists X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=dca674991ed7e345efa67d102de0ec1b0581503a;p=collectd.git virt plugin: Submit `ps_cputime' only when data exists --- 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);