summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e175e66)
raw | patch | inline | side by side (parent: e175e66)
author | Florian Forster <octo@collectd.org> | |
Tue, 7 Feb 2012 16:59:00 +0000 (17:59 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 7 Feb 2012 16:59:00 +0000 (17:59 +0100) |
Most of it was already present in the code anyway, so I just added the
appropriate config handling.
Change-Id: I7ce8be2f5b075da690872ec72b3610eae05b3c6c
appropriate config handling.
Change-Id: I7ce8be2f5b075da690872ec72b3610eae05b3c6c
src/collectd.conf.pod | patch | blob | history | |
src/write_graphite.c | patch | blob | history |
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index be2e8027085279eed1c746587854a28228d013b1..64ef7f2e9e49db053737dee5da9764bc1270797c 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
dots, whitespace and control characters are replaced with. Defaults to
underscore (C<_>).
+=item B<StoreRates> B<false>|B<true>
+
+If set to B<true>, convert counter values to rates. If set to B<false> (the
+default) counter values are stored as is, i.E<nbsp>e. as an increasing integer
+number.
+
=back
=head2 Plugin C<write_http>
diff --git a/src/write_graphite.c b/src/write_graphite.c
index f7ed1959e0b2dd471f892e1bed25dc97271e846e..cc4e38a3a7d69a695028e95a1f70c0afcd658bf3 100644 (file)
--- a/src/write_graphite.c
+++ b/src/write_graphite.c
char *postfix;
char escape_char;
+ _Bool store_rates;
+
char send_buf[WG_SEND_BUF_SIZE];
size_t send_buf_free;
size_t send_buf_fill;
escape_string (key, sizeof (key));
/* Convert the values to an ASCII representation and put that
* into `values'. */
- status = wg_format_values (values, sizeof (values), i, ds, vl, 0);
+ status = wg_format_values (values, sizeof (values), i, ds, vl,
+ cb->store_rates);
if (status != 0)
{
ERROR ("write_graphite plugin: error with "
escape_string (key, sizeof (key));
/* Convert the values to an ASCII representation and put that into
* `values'. */
- status = wg_format_values (values, sizeof (values), 0, ds, vl, 0);
+ status = wg_format_values (values, sizeof (values), 0, ds, vl,
+ cb->store_rates);
if (status != 0)
{
ERROR ("write_graphite plugin: error with "
cf_util_get_string (child, &cb->prefix);
else if (strcasecmp ("Postfix", child->key) == 0)
cf_util_get_string (child, &cb->postfix);
+ else if (strcasecmp ("StoreRates", child->key) == 0)
+ cf_util_get_boolean (child, &cb->store_rates);
else if (strcasecmp ("EscapeCharacter", child->key) == 0)
config_set_char (&cb->escape_char, child);
else