summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 83d8820)
raw | patch | inline | side by side (parent: 83d8820)
author | Florian Forster <octo@collectd.org> | |
Mon, 20 Feb 2012 16:20:21 +0000 (17:20 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Mon, 20 Feb 2012 16:24:46 +0000 (17:24 +0100) |
Change-Id: I8670b62ed323698c7764d3039ccd8af052bd1b6f
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 fbdd23d717efc4c62467778673d99c10f2bca4d9..6f79266a98b4ead38c5e39945a4854d67312ae3d 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
default) counter values are stored as is, i.E<nbsp>e. as an increasing integer
number.
+=item B<SeparateInstances> B<false>|B<true>
+
+If set to B<true>, the plugin instance and type instance will be in their own
+path component, for example C<host.cpu.0.cpu.idle>. If set to B<false> (the
+default), the plugin and plugin instance (and likewise the type and type
+instance) are put into once component, for example C<host.cpu-0.cpu-idle>.
+
=item B<AlwaysAppendDS> B<false>|B<true>
If set the B<true>, append the name of the I<Data Source> (DS) to the "metric"
diff --git a/src/write_graphite.c b/src/write_graphite.c
index 3ff8e04d991396df22fa0b91239d2b9c45d758e3..e59572b1ac1b65f9e3b2a3fa38e5ab48660bbbb7 100644 (file)
--- a/src/write_graphite.c
+++ b/src/write_graphite.c
char escape_char;
_Bool store_rates;
+ _Bool separate_instances;
_Bool always_append_ds;
char send_buf[WG_SEND_BUF_SIZE];
sizeof (n_type_instance), cb->escape_char);
if (n_plugin_instance[0] != '\0')
- ssnprintf (tmp_plugin, sizeof (tmp_plugin), "%s-%s",
- n_plugin, n_plugin_instance);
+ ssnprintf (tmp_plugin, sizeof (tmp_plugin), "%s%c%s",
+ n_plugin,
+ cb->separate_instances ? '.' : '-',
+ n_plugin_instance);
else
sstrncpy (tmp_plugin, n_plugin, sizeof (tmp_plugin));
if (n_type_instance[0] != '\0')
- ssnprintf (tmp_type, sizeof (tmp_type), "%s-%s",
- n_type, n_type_instance);
+ ssnprintf (tmp_type, sizeof (tmp_type), "%s%c%s",
+ n_type,
+ cb->separate_instances ? '.' : '-',
+ n_type_instance);
else
sstrncpy (tmp_type, n_type, sizeof (tmp_type));
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 ("SeparateInstances", child->key) == 0)
+ cf_util_get_boolean (child, &cb->separate_instances);
else if (strcasecmp ("AlwaysAppendDS", child->key) == 0)
cf_util_get_boolean (child, &cb->always_append_ds);
else if (strcasecmp ("EscapeCharacter", child->key) == 0)