summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a7eecf6)
raw | patch | inline | side by side (parent: a7eecf6)
author | Dallin Young <dallin.young@gmail.com> | |
Fri, 20 Feb 2015 18:33:00 +0000 (19:33 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 10 Mar 2015 14:18:50 +0000 (15:18 +0100) |
Previously, the generated names were wrong, especially when no
plugin instance was used for a metric.
Fixes: #945
Signed-off-by: Florian Forster <octo@collectd.org>
plugin instance was used for a metric.
Fixes: #945
Signed-off-by: Florian Forster <octo@collectd.org>
src/write_tsdb.c | patch | blob | history |
diff --git a/src/write_tsdb.c b/src/write_tsdb.c
index b7f46f1b9abde92bae63eee39d244e7fa6380ae2..bfac1a140d4020c065f7b473e5a19dc72013ad90 100644 (file)
--- a/src/write_tsdb.c
+++ b/src/write_tsdb.c
if (ds_name != NULL) {
if (vl->plugin_instance[0] == '\0') {
- ssnprintf(ret, ret_len, "%s%s.%s",
- prefix, vl->plugin, ds_name);
+ if (vl->type_instance[0] == '\0') {
+ ssnprintf(ret, ret_len, "%s%s.%s.%s",
+ prefix, vl->plugin, vl->type,
+ ds_name);
+ } else {
+ ssnprintf(ret, ret_len, "%s%s.%s.%s",
+ prefix, vl->plugin, vl->type_instance,
+ ds_name);
+ }
} else if (vl->type_instance[0] == '\0') {
- ssnprintf(ret, ret_len, "%s%s.%s.%s.%s",
- prefix, vl->plugin, vl->plugin_instance,
- vl->type_instance, ds_name);
- } else {
ssnprintf(ret, ret_len, "%s%s.%s.%s.%s",
prefix, vl->plugin, vl->plugin_instance, vl->type,
ds_name);
+ } else {
+ ssnprintf(ret, ret_len, "%s%s.%s.%s.%s.%s",
+ prefix, vl->plugin, vl->plugin_instance, vl->type,
+ vl->type_instance, ds_name);
}
} else if (vl->plugin_instance[0] == '\0') {
- if (vl->type_instance[0] == '\0')
+ if (vl->type_instance[0] == '\0') {
ssnprintf(ret, ret_len, "%s%s.%s",
prefix, vl->plugin, vl->type);
- else
+ } else {
ssnprintf(ret, ret_len, "%s%s.%s",
prefix, vl->plugin, vl->type_instance);
+ }
} else if (vl->type_instance[0] == '\0') {
ssnprintf(ret, ret_len, "%s%s.%s.%s",
prefix, vl->plugin, vl->plugin_instance, vl->type);