From: Florian Forster Date: Mon, 7 Feb 2011 06:40:22 +0000 (+0100) Subject: varnish plugin: Use a DERIVE type for allocated and free bytes. X-Git-Tag: collectd-5.0.0~6 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=ef3c8ce93f6cfb2517a2b2d6ea7c07a81e8c41f3 varnish plugin: Use a DERIVE type for allocated and free bytes. Each event is counted, so storing a GAUGE is not the right thing to do. Thanks to Renaud Chaput for pointing this out. N.B.: The total amount of allocated memory is tracked by "bytes-outstanding" for many storage backends. --- diff --git a/src/varnish.c b/src/varnish.c index 6bf2db73..859df217 100644 --- a/src/varnish.c +++ b/src/varnish.c @@ -307,9 +307,9 @@ static void varnish_monitor (const user_config_t *conf, struct varnish_stats *VS /* outstanding allocations */ varnish_submit_gauge (conf->instance, "sm", "requests", "outstanding", VSL_stats->sm_nobj); /* bytes allocated */ - varnish_submit_gauge (conf->instance, "sm", "bytes", "allocated", VSL_stats->sm_balloc); + varnish_submit_gauge (conf->instance, "sm", "total_bytes", "allocated", VSL_stats->sm_balloc); /* bytes free */ - varnish_submit_gauge (conf->instance, "sm", "bytes", "free", VSL_stats->sm_bfree); + varnish_submit_gauge (conf->instance, "sm", "total_bytes", "free", VSL_stats->sm_bfree); } if (conf->collect_sma) @@ -321,9 +321,9 @@ static void varnish_monitor (const user_config_t *conf, struct varnish_stats *VS /* SMA outstanding bytes */ varnish_submit_gauge (conf->instance, "sma", "bytes", "outstanding", VSL_stats->sma_nbytes); /* SMA bytes allocated */ - varnish_submit_gauge (conf->instance, "sma", "bytes", "allocated", VSL_stats->sma_balloc); + varnish_submit_gauge (conf->instance, "sma", "total_bytes", "allocated", VSL_stats->sma_balloc); /* SMA bytes free */ - varnish_submit_gauge (conf->instance, "sma", "bytes", "free" , VSL_stats->sma_bfree); + varnish_submit_gauge (conf->instance, "sma", "total_bytes", "free" , VSL_stats->sma_bfree); } if (conf->collect_sms) @@ -335,9 +335,9 @@ static void varnish_monitor (const user_config_t *conf, struct varnish_stats *VS /* SMS outstanding bytes */ varnish_submit_gauge (conf->instance, "sms", "bytes", "outstanding", VSL_stats->sms_nbytes); /* SMS bytes allocated */ - varnish_submit_gauge (conf->instance, "sms", "bytes", "allocated", VSL_stats->sms_balloc); + varnish_submit_gauge (conf->instance, "sms", "total_bytes", "allocated", VSL_stats->sms_balloc); /* SMS bytes freed */ - varnish_submit_gauge (conf->instance, "sms", "bytes", "free", VSL_stats->sms_bfree); + varnish_submit_gauge (conf->instance, "sms", "total_bytes", "free", VSL_stats->sms_bfree); } if (conf->collect_totals)