summaryrefslogtreecommitdiffstats
path: root/src/proc_vmstat.c
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2016-11-23 15:49:10 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2016-11-23 15:49:10 +0000
commit87649cf32bd0e14d5a903fb85b01e9f41a253540 (patch)
treebbefda6dac074aeb87529592e8e5064f69cbe024 /src/proc_vmstat.c
parentImported Upstream version 1.3.0+dfsg (diff)
downloadnetdata-87649cf32bd0e14d5a903fb85b01e9f41a253540.tar.xz
netdata-87649cf32bd0e14d5a903fb85b01e9f41a253540.zip
New upstream version 1.4.0+dfsgupstream/1.4.0+dfsg
Diffstat (limited to 'src/proc_vmstat.c')
-rw-r--r--src/proc_vmstat.c12
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);