diff options
author | Federico Ceratto <federico.ceratto@gmail.com> | 2016-11-23 15:49:14 +0000 |
---|---|---|
committer | Federico Ceratto <federico.ceratto@gmail.com> | 2016-11-23 15:49:14 +0000 |
commit | 68141d9dac0c08e51d257feef16a79086dd8a2df (patch) | |
tree | f4a0f5d31ed2194b5991130754b297b9c8c076e6 /src/proc_vmstat.c | |
parent | Release v. 1.3.0+dfsg-1 to Unstable (diff) | |
parent | New upstream version 1.4.0+dfsg (diff) | |
download | netdata-68141d9dac0c08e51d257feef16a79086dd8a2df.tar.xz netdata-68141d9dac0c08e51d257feef16a79086dd8a2df.zip |
Merge tag 'upstream/1.4.0+dfsg'
Upstream version 1.4.0+dfsg
Diffstat (limited to 'src/proc_vmstat.c')
-rw-r--r-- | src/proc_vmstat.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/proc_vmstat.c b/src/proc_vmstat.c index f25d50c50..5f4e5aadd 100644 --- a/src/proc_vmstat.c +++ b/src/proc_vmstat.c @@ -193,11 +193,11 @@ int do_proc_vmstat(int update_every, unsigned long long dt) { // hash_unevictable_pgs_stranded = simple_hash("unevictable_pgs_stranded"); } - if(do_swapio == -1) do_swapio = config_get_boolean("plugin:proc:/proc/vmstat", "swap i/o", 1); - if(do_io == -1) do_io = config_get_boolean("plugin:proc:/proc/vmstat", "disk i/o", 1); - if(do_pgfaults == -1) do_pgfaults = config_get_boolean("plugin:proc:/proc/vmstat", "memory page faults", 1); + if(do_swapio == -1) do_swapio = config_get_boolean_ondemand("plugin:proc:/proc/vmstat", "swap i/o", CONFIG_ONDEMAND_ONDEMAND); + if(do_io == -1) do_io = config_get_boolean("plugin:proc:/proc/vmstat", "disk i/o", 1); + if(do_pgfaults == -1) do_pgfaults = config_get_boolean("plugin:proc:/proc/vmstat", "memory page faults", 1); - if(dt) {}; + (void)dt; if(!ff) { char filename[FILENAME_MAX + 1]; @@ -415,7 +415,9 @@ int do_proc_vmstat(int update_every, unsigned long long dt) { // -------------------------------------------------------------------- - if(do_swapio) { + if(pswpin || pswpout || do_swapio == CONFIG_ONDEMAND_YES) { + do_swapio = CONFIG_ONDEMAND_YES; + static RRDSET *st_swapio = NULL; if(!st_swapio) { st_swapio = rrdset_create("system", "swapio", NULL, "swap", NULL, "Swap I/O", "kilobytes/s", 250, update_every, RRDSET_TYPE_AREA); |