varnish plugin: Use a DERIVE type for allocated and free bytes.
[collectd.git] / src / varnish.c
index c5a759e..859df21 100644 (file)
@@ -1,6 +1,8 @@
 /**
  * collectd - src/varnish.c
- * Copyright (C) 2010 Jerome Renard
+ * Copyright (C) 2010 Jérôme Renard
+ * Copyright (C) 2010 Marc Fournier
+ * Copyright (C) 2010 Florian Forster
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -16,8 +18,9 @@
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  *
  * Authors:
+ *   Jérôme Renard <jerome.renard at gmail.com>
+ *   Marc Fournier <marc.fournier at camptocamp.com>
  *   Florian octo Forster <octo at verplant.org>
- *   Jerome Renard <jerome.renard@gmail.com>
  **/
 
 /**
@@ -304,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)
@@ -318,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)
@@ -332,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)