projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b1db019
)
virt plugin: Submit `ps_cputime' only when data exists
author
Pavel Rochnyack
<pavel2000@ngs.ru>
Thu, 25 Oct 2018 08:37:20 +0000
(15:37 +0700)
committer
Pavel Rochnyack
<pavel2000@ngs.ru>
Thu, 25 Oct 2018 08:37:26 +0000
(15:37 +0700)
src/virt.c
patch
|
blob
|
history
diff --git
a/src/virt.c
b/src/virt.c
index
21df2d6
..
e7f11fc
100644
(file)
--- 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);