summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 686286b)
raw | patch | inline | side by side (parent: 686286b)
author | Florian Forster <octo@collectd.org> | |
Mon, 13 Feb 2012 20:27:40 +0000 (21:27 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Mon, 13 Feb 2012 20:27:40 +0000 (21:27 +0100) |
Change-Id: Iab70d4f40a614bc04b70b61868d30721ee9641c1
src/write_graphite.c | patch | blob | history |
diff --git a/src/write_graphite.c b/src/write_graphite.c
index fc2e2edde5ad334859b025e02e567da8b1131207..3ff8e04d991396df22fa0b91239d2b9c45d758e3 100644 (file)
--- a/src/write_graphite.c
+++ b/src/write_graphite.c
cb->send_buf_fill += message_len;
cb->send_buf_free -= message_len;
- DEBUG ("write_graphite plugin: <%s:%s> buf %zu/%zu (%g%%) \"%s\"",
+ DEBUG ("write_graphite plugin: [%s]:%s buf %zu/%zu (%.1f %%) \"%s\"",
cb->node,
cb->service,
cb->send_buf_fill, sizeof (cb->send_buf),
{
struct wg_callback *cb;
user_data_t user_data;
+ char callback_name[DATA_MAX_NAME_LEN];
int i;
cb = malloc (sizeof (*cb));
}
}
- DEBUG ("write_graphite: Registering write callback to carbon agent %s:%s",
- cb->node ? cb->node : WG_DEFAULT_NODE,
- cb->service ? cb->service : WG_DEFAULT_SERVICE);
+ ssnprintf (callback_name, sizeof (callback_name), "write_graphite/%s/%s",
+ cb->node != NULL ? cb->node : WG_DEFAULT_NODE,
+ cb->service != NULL ? cb->service : WG_DEFAULT_SERVICE);
memset (&user_data, 0, sizeof (user_data));
user_data.data = cb;
- user_data.free_func = NULL;
- plugin_register_flush ("write_graphite", wg_flush, &user_data);
-
user_data.free_func = wg_callback_free;
- plugin_register_write ("write_graphite", wg_write, &user_data);
+ plugin_register_write (callback_name, wg_write, &user_data);
+
+ user_data.free_func = NULL;
+ plugin_register_flush (callback_name, wg_flush, &user_data);
return (0);
}