2 * collectd - src/statsd.c
3 * Copyright (C) 2013 Florian octo Forster
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
24 * Florian octo Forster <octo at collectd.org>
30 #include "configfile.h"
31 #include "utils_avltree.h"
32 #include "utils_complain.h"
33 #include "utils_latency.h"
37 #include <sys/types.h>
41 /* AIX doesn't have MSG_DONTWAIT */
43 # define MSG_DONTWAIT MSG_NONBLOCK
46 #ifndef STATSD_DEFAULT_NODE
47 # define STATSD_DEFAULT_NODE NULL
50 #ifndef STATSD_DEFAULT_SERVICE
51 # define STATSD_DEFAULT_SERVICE "8125"
61 typedef enum metric_type_e metric_type_t;
63 struct statsd_metric_s
68 latency_counter_t *latency;
70 unsigned long updates_num;
72 typedef struct statsd_metric_s statsd_metric_t;
74 static c_avl_tree_t *metrics_tree = NULL;
75 static pthread_mutex_t metrics_lock = PTHREAD_MUTEX_INITIALIZER;
77 static pthread_t network_thread;
78 static _Bool network_thread_running = 0;
79 static _Bool network_thread_shutdown = 0;
81 static char *conf_node = NULL;
82 static char *conf_service = NULL;
84 static _Bool conf_delete_counters = 0;
85 static _Bool conf_delete_timers = 0;
86 static _Bool conf_delete_gauges = 0;
87 static _Bool conf_delete_sets = 0;
89 static double *conf_timer_percentile = NULL;
90 static size_t conf_timer_percentile_num = 0;
92 static _Bool conf_counter_sum = 0;
93 static _Bool conf_timer_lower = 0;
94 static _Bool conf_timer_upper = 0;
95 static _Bool conf_timer_sum = 0;
96 static _Bool conf_timer_count = 0;
98 /* Must hold metrics_lock when calling this function. */
99 static statsd_metric_t *statsd_metric_lookup_unsafe (char const *name, /* {{{ */
102 char key[DATA_MAX_NAME_LEN + 2];
104 statsd_metric_t *metric;
109 case STATSD_COUNTER: key[0] = 'c'; break;
110 case STATSD_TIMER: key[0] = 't'; break;
111 case STATSD_GAUGE: key[0] = 'g'; break;
112 case STATSD_SET: key[0] = 's'; break;
113 default: return (NULL);
117 sstrncpy (&key[2], name, sizeof (key) - 2);
119 status = c_avl_get (metrics_tree, key, (void *) &metric);
123 key_copy = strdup (key);
124 if (key_copy == NULL)
126 ERROR ("statsd plugin: strdup failed.");
130 metric = malloc (sizeof (*metric));
133 ERROR ("statsd plugin: malloc failed.");
137 memset (metric, 0, sizeof (*metric));
140 metric->latency = NULL;
143 status = c_avl_insert (metrics_tree, key_copy, metric);
146 ERROR ("statsd plugin: c_avl_insert failed.");
153 } /* }}} statsd_metric_lookup_unsafe */
155 static int statsd_metric_set (char const *name, double value, /* {{{ */
158 statsd_metric_t *metric;
160 pthread_mutex_lock (&metrics_lock);
162 metric = statsd_metric_lookup_unsafe (name, type);
165 pthread_mutex_unlock (&metrics_lock);
169 metric->value = value;
170 metric->updates_num++;
172 pthread_mutex_unlock (&metrics_lock);
175 } /* }}} int statsd_metric_set */
177 static int statsd_metric_add (char const *name, double delta, /* {{{ */
180 statsd_metric_t *metric;
182 pthread_mutex_lock (&metrics_lock);
184 metric = statsd_metric_lookup_unsafe (name, type);
187 pthread_mutex_unlock (&metrics_lock);
191 metric->value += delta;
192 metric->updates_num++;
194 pthread_mutex_unlock (&metrics_lock);
197 } /* }}} int statsd_metric_add */
199 static void statsd_metric_free (statsd_metric_t *metric) /* {{{ */
204 if (metric->latency != NULL)
206 latency_counter_destroy (metric->latency);
207 metric->latency = NULL;
210 if (metric->set != NULL)
215 while (c_avl_pick (metric->set, &key, &value) == 0)
218 assert (value == NULL);
221 c_avl_destroy (metric->set);
226 } /* }}} void statsd_metric_free */
228 static int statsd_parse_value (char const *str, value_t *ret_value) /* {{{ */
232 ret_value->gauge = (gauge_t) strtod (str, &endptr);
233 if ((str == endptr) || ((endptr != NULL) && (*endptr != 0)))
237 } /* }}} int statsd_parse_value */
239 static int statsd_handle_counter (char const *name, /* {{{ */
240 char const *value_str,
247 if ((extra != NULL) && (extra[0] != '@'))
253 status = statsd_parse_value (extra + 1, &scale);
257 if (!isfinite (scale.gauge) || (scale.gauge <= 0.0) || (scale.gauge > 1.0))
262 status = statsd_parse_value (value_str, &value);
266 /* Changes to the counter are added to (statsd_metric_t*)->value. ->counter is
267 * only updated in statsd_metric_submit_unsafe(). */
268 return (statsd_metric_add (name, (double) (value.gauge / scale.gauge),
270 } /* }}} int statsd_handle_counter */
272 static int statsd_handle_gauge (char const *name, /* {{{ */
273 char const *value_str)
279 status = statsd_parse_value (value_str, &value);
283 if ((value_str[0] == '+') || (value_str[0] == '-'))
284 return (statsd_metric_add (name, (double) value.gauge, STATSD_GAUGE));
286 return (statsd_metric_set (name, (double) value.gauge, STATSD_GAUGE));
287 } /* }}} int statsd_handle_gauge */
289 static int statsd_handle_timer (char const *name, /* {{{ */
290 char const *value_str,
293 statsd_metric_t *metric;
299 if ((extra != NULL) && (extra[0] != '@'))
305 status = statsd_parse_value (extra + 1, &scale);
309 if (!isfinite (scale.gauge) || (scale.gauge <= 0.0) || (scale.gauge > 1.0))
314 status = statsd_parse_value (value_str, &value_ms);
318 value = MS_TO_CDTIME_T (value_ms.gauge / scale.gauge);
320 pthread_mutex_lock (&metrics_lock);
322 metric = statsd_metric_lookup_unsafe (name, STATSD_TIMER);
325 pthread_mutex_unlock (&metrics_lock);
329 if (metric->latency == NULL)
330 metric->latency = latency_counter_create ();
331 if (metric->latency == NULL)
333 pthread_mutex_unlock (&metrics_lock);
337 latency_counter_add (metric->latency, value);
338 metric->updates_num++;
340 pthread_mutex_unlock (&metrics_lock);
342 } /* }}} int statsd_handle_timer */
344 static int statsd_handle_set (char const *name, /* {{{ */
345 char const *set_key_orig)
347 statsd_metric_t *metric = NULL;
351 pthread_mutex_lock (&metrics_lock);
353 metric = statsd_metric_lookup_unsafe (name, STATSD_SET);
356 pthread_mutex_unlock (&metrics_lock);
360 /* Make sure metric->set exists. */
361 if (metric->set == NULL)
362 metric->set = c_avl_create ((void *) strcmp);
364 if (metric->set == NULL)
366 pthread_mutex_unlock (&metrics_lock);
367 ERROR ("statsd plugin: c_avl_create failed.");
371 set_key = strdup (set_key_orig);
374 pthread_mutex_unlock (&metrics_lock);
375 ERROR ("statsd plugin: strdup failed.");
379 status = c_avl_insert (metric->set, set_key, /* value = */ NULL);
382 pthread_mutex_unlock (&metrics_lock);
384 ERROR ("statsd plugin: c_avl_insert (\"%s\") failed with status %i.",
389 else if (status > 0) /* key already exists */
394 metric->updates_num++;
396 pthread_mutex_unlock (&metrics_lock);
398 } /* }}} int statsd_handle_set */
400 static int statsd_parse_line (char *buffer) /* {{{ */
407 type = strchr (name, '|');
413 value = strrchr (name, ':');
419 extra = strchr (type, '|');
426 if (strcmp ("c", type) == 0)
427 return (statsd_handle_counter (name, value, extra));
428 else if (strcmp ("ms", type) == 0)
429 return (statsd_handle_timer (name, value, extra));
431 /* extra is only valid for counters and timers */
435 if (strcmp ("g", type) == 0)
436 return (statsd_handle_gauge (name, value));
437 else if (strcmp ("s", type) == 0)
438 return (statsd_handle_set (name, value));
441 } /* }}} void statsd_parse_line */
443 static void statsd_parse_buffer (char *buffer) /* {{{ */
445 while (buffer != NULL)
451 next = strchr (buffer, '\n');
464 sstrncpy (orig, buffer, sizeof (orig));
466 status = statsd_parse_line (buffer);
468 ERROR ("statsd plugin: Unable to parse line: \"%s\"", orig);
472 } /* }}} void statsd_parse_buffer */
474 static void statsd_network_read (int fd) /* {{{ */
480 status = recv (fd, buffer, sizeof (buffer), /* flags = */ MSG_DONTWAIT);
485 if ((errno == EAGAIN) || (errno == EWOULDBLOCK))
488 ERROR ("statsd plugin: recv(2) failed: %s",
489 sstrerror (errno, errbuf, sizeof (errbuf)));
493 buffer_size = (size_t) status;
494 if (buffer_size >= sizeof (buffer))
495 buffer_size = sizeof (buffer) - 1;
496 buffer[buffer_size] = 0;
498 statsd_parse_buffer (buffer);
499 } /* }}} void statsd_network_read */
501 static int statsd_network_init (struct pollfd **ret_fds, /* {{{ */
504 struct pollfd *fds = NULL;
507 struct addrinfo ai_hints;
508 struct addrinfo *ai_list = NULL;
509 struct addrinfo *ai_ptr;
512 char const *node = (conf_node != NULL) ? conf_node : STATSD_DEFAULT_NODE;
513 char const *service = (conf_service != NULL)
514 ? conf_service : STATSD_DEFAULT_SERVICE;
516 memset (&ai_hints, 0, sizeof (ai_hints));
517 ai_hints.ai_flags = AI_PASSIVE;
519 ai_hints.ai_flags |= AI_ADDRCONFIG;
521 ai_hints.ai_family = AF_UNSPEC;
522 ai_hints.ai_socktype = SOCK_DGRAM;
524 status = getaddrinfo (node, service, &ai_hints, &ai_list);
527 ERROR ("statsd plugin: getaddrinfo (\"%s\", \"%s\") failed: %s",
528 node, service, gai_strerror (status));
532 for (ai_ptr = ai_list; ai_ptr != NULL; ai_ptr = ai_ptr->ai_next)
537 char dbg_node[NI_MAXHOST];
538 char dbg_service[NI_MAXSERV];
540 fd = socket (ai_ptr->ai_family, ai_ptr->ai_socktype, ai_ptr->ai_protocol);
544 ERROR ("statsd plugin: socket(2) failed: %s",
545 sstrerror (errno, errbuf, sizeof (errbuf)));
549 getnameinfo (ai_ptr->ai_addr, ai_ptr->ai_addrlen,
550 dbg_node, sizeof (dbg_node), dbg_service, sizeof (dbg_service),
551 NI_DGRAM | NI_NUMERICHOST | NI_NUMERICSERV);
552 DEBUG ("statsd plugin: Trying to bind to [%s]:%s ...", dbg_node, dbg_service);
554 status = bind (fd, ai_ptr->ai_addr, ai_ptr->ai_addrlen);
558 ERROR ("statsd plugin: bind(2) failed: %s",
559 sstrerror (errno, errbuf, sizeof (errbuf)));
564 tmp = realloc (fds, sizeof (*fds) * (fds_num + 1));
567 ERROR ("statsd plugin: realloc failed.");
575 memset (tmp, 0, sizeof (*tmp));
577 tmp->events = POLLIN | POLLPRI;
580 freeaddrinfo (ai_list);
584 ERROR ("statsd plugin: Unable to create listening socket for [%s]:%s.",
585 (node != NULL) ? node : "::", service);
590 *ret_fds_num = fds_num;
592 } /* }}} int statsd_network_init */
594 static void *statsd_network_thread (void *args) /* {{{ */
596 struct pollfd *fds = NULL;
601 status = statsd_network_init (&fds, &fds_num);
604 ERROR ("statsd plugin: Unable to open listening sockets.");
605 pthread_exit ((void *) 0);
608 while (!network_thread_shutdown)
610 status = poll (fds, (nfds_t) fds_num, /* timeout = */ -1);
615 if ((errno == EINTR) || (errno == EAGAIN))
618 ERROR ("statsd plugin: poll(2) failed: %s",
619 sstrerror (errno, errbuf, sizeof (errbuf)));
623 for (i = 0; i < fds_num; i++)
625 if ((fds[i].revents & (POLLIN | POLLPRI)) == 0)
628 statsd_network_read (fds[i].fd);
631 } /* while (!network_thread_shutdown) */
634 for (i = 0; i < fds_num; i++)
639 } /* }}} void *statsd_network_thread */
641 static int statsd_config_timer_percentile (oconfig_item_t *ci) /* {{{ */
643 double percent = NAN;
647 status = cf_util_get_double (ci, &percent);
651 if ((percent <= 0.0) || (percent >= 100))
653 ERROR ("statsd plugin: The value for \"%s\" must be between 0 and 100, "
654 "exclusively.", ci->key);
658 tmp = realloc (conf_timer_percentile,
659 sizeof (*conf_timer_percentile) * (conf_timer_percentile_num + 1));
662 ERROR ("statsd plugin: realloc failed.");
665 conf_timer_percentile = tmp;
666 conf_timer_percentile[conf_timer_percentile_num] = percent;
667 conf_timer_percentile_num++;
670 } /* }}} int statsd_config_timer_percentile */
672 static int statsd_config (oconfig_item_t *ci) /* {{{ */
676 for (i = 0; i < ci->children_num; i++)
678 oconfig_item_t *child = ci->children + i;
680 if (strcasecmp ("Host", child->key) == 0)
681 cf_util_get_string (child, &conf_node);
682 else if (strcasecmp ("Port", child->key) == 0)
683 cf_util_get_service (child, &conf_service);
684 else if (strcasecmp ("DeleteCounters", child->key) == 0)
685 cf_util_get_boolean (child, &conf_delete_counters);
686 else if (strcasecmp ("DeleteTimers", child->key) == 0)
687 cf_util_get_boolean (child, &conf_delete_timers);
688 else if (strcasecmp ("DeleteGauges", child->key) == 0)
689 cf_util_get_boolean (child, &conf_delete_gauges);
690 else if (strcasecmp ("DeleteSets", child->key) == 0)
691 cf_util_get_boolean (child, &conf_delete_sets);
692 else if (strcasecmp ("CounterSum", child->key) == 0)
693 cf_util_get_boolean (child, &conf_counter_sum);
694 else if (strcasecmp ("TimerLower", child->key) == 0)
695 cf_util_get_boolean (child, &conf_timer_lower);
696 else if (strcasecmp ("TimerUpper", child->key) == 0)
697 cf_util_get_boolean (child, &conf_timer_upper);
698 else if (strcasecmp ("TimerSum", child->key) == 0)
699 cf_util_get_boolean (child, &conf_timer_sum);
700 else if (strcasecmp ("TimerCount", child->key) == 0)
701 cf_util_get_boolean (child, &conf_timer_count);
702 else if (strcasecmp ("TimerPercentile", child->key) == 0)
703 statsd_config_timer_percentile (child);
705 ERROR ("statsd plugin: The \"%s\" config option is not valid.",
710 } /* }}} int statsd_config */
712 static int statsd_init (void) /* {{{ */
714 pthread_mutex_lock (&metrics_lock);
715 if (metrics_tree == NULL)
716 metrics_tree = c_avl_create ((void *) strcmp);
718 if (!network_thread_running)
722 status = pthread_create (&network_thread,
724 statsd_network_thread,
729 pthread_mutex_unlock (&metrics_lock);
730 ERROR ("statsd plugin: pthread_create failed: %s",
731 sstrerror (errno, errbuf, sizeof (errbuf)));
735 network_thread_running = 1;
737 pthread_mutex_unlock (&metrics_lock);
740 } /* }}} int statsd_init */
742 /* Must hold metrics_lock when calling this function. */
743 static int statsd_metric_clear_set_unsafe (statsd_metric_t *metric) /* {{{ */
748 if ((metric == NULL) || (metric->type != STATSD_SET))
751 if (metric->set == NULL)
754 while (c_avl_pick (metric->set, &key, &value) == 0)
761 } /* }}} int statsd_metric_clear_set_unsafe */
763 /* Must hold metrics_lock when calling this function. */
764 static int statsd_metric_submit_unsafe (char const *name, statsd_metric_t *metric) /* {{{ */
767 value_list_t vl = VALUE_LIST_INIT;
771 sstrncpy (vl.host, hostname_g, sizeof (vl.host));
772 sstrncpy (vl.plugin, "statsd", sizeof (vl.plugin));
774 if (metric->type == STATSD_GAUGE)
775 sstrncpy (vl.type, "gauge", sizeof (vl.type));
776 else if (metric->type == STATSD_TIMER)
777 sstrncpy (vl.type, "latency", sizeof (vl.type));
778 else if (metric->type == STATSD_SET)
779 sstrncpy (vl.type, "objects", sizeof (vl.type));
780 else /* if (metric->type == STATSD_COUNTER) */
781 sstrncpy (vl.type, "derive", sizeof (vl.type));
783 sstrncpy (vl.type_instance, name, sizeof (vl.type_instance));
785 if (metric->type == STATSD_GAUGE)
786 values[0].gauge = (gauge_t) metric->value;
787 else if (metric->type == STATSD_TIMER)
790 _Bool have_events = (metric->updates_num > 0);
792 /* Make sure all timer metrics share the *same* timestamp. */
795 ssnprintf (vl.type_instance, sizeof (vl.type_instance),
797 values[0].gauge = have_events
798 ? CDTIME_T_TO_DOUBLE (latency_counter_get_average (metric->latency))
800 plugin_dispatch_values (&vl);
802 if (conf_timer_lower) {
803 ssnprintf (vl.type_instance, sizeof (vl.type_instance),
805 values[0].gauge = have_events
806 ? CDTIME_T_TO_DOUBLE (latency_counter_get_min (metric->latency))
808 plugin_dispatch_values (&vl);
811 if (conf_timer_upper) {
812 ssnprintf (vl.type_instance, sizeof (vl.type_instance),
814 values[0].gauge = have_events
815 ? CDTIME_T_TO_DOUBLE (latency_counter_get_max (metric->latency))
817 plugin_dispatch_values (&vl);
820 if (conf_timer_sum) {
821 ssnprintf (vl.type_instance, sizeof (vl.type_instance),
823 values[0].gauge = have_events
824 ? CDTIME_T_TO_DOUBLE (latency_counter_get_sum (metric->latency))
826 plugin_dispatch_values (&vl);
829 for (i = 0; i < conf_timer_percentile_num; i++)
831 ssnprintf (vl.type_instance, sizeof (vl.type_instance),
832 "%s-percentile-%.0f", name, conf_timer_percentile[i]);
833 values[0].gauge = have_events
834 ? CDTIME_T_TO_DOUBLE (latency_counter_get_percentile (metric->latency, conf_timer_percentile[i]))
836 plugin_dispatch_values (&vl);
839 /* Keep this at the end, since vl.type is set to "gauge" here. The
840 * vl.type's above are implicitly set to "latency". */
841 if (conf_timer_count) {
842 sstrncpy (vl.type, "gauge", sizeof (vl.type));
843 ssnprintf (vl.type_instance, sizeof (vl.type_instance),
845 values[0].gauge = latency_counter_get_num (metric->latency);
846 plugin_dispatch_values (&vl);
849 latency_counter_reset (metric->latency);
852 else if (metric->type == STATSD_SET)
854 if (metric->set == NULL)
855 values[0].gauge = 0.0;
857 values[0].gauge = (gauge_t) c_avl_size (metric->set);
859 else { /* STATSD_COUNTER */
860 gauge_t delta = nearbyint (metric->value);
862 /* Etsy's statsd writes counters as two metrics: a rate and the change since
863 * the last write. Since collectd does not reset its DERIVE metrics to zero,
864 * this makes little sense, but we're dispatching a "count" metric here
865 * anyway - if requested by the user - for compatibility reasons. */
866 if (conf_counter_sum)
868 sstrncpy (vl.type, "count", sizeof (vl.type));
869 values[0].gauge = delta;
870 plugin_dispatch_values (&vl);
872 /* restore vl.type */
873 sstrncpy (vl.type, "derive", sizeof (vl.type));
876 /* Rather than resetting value to zero, subtract delta so we correctly keep
877 * track of residuals. */
878 metric->value -= delta;
879 metric->counter += (derive_t) delta;
881 values[0].derive = metric->counter;
884 return (plugin_dispatch_values (&vl));
885 } /* }}} int statsd_metric_submit_unsafe */
887 static int statsd_read (void) /* {{{ */
889 c_avl_iterator_t *iter;
891 statsd_metric_t *metric;
893 char **to_be_deleted = NULL;
894 size_t to_be_deleted_num = 0;
897 pthread_mutex_lock (&metrics_lock);
899 if (metrics_tree == NULL)
901 pthread_mutex_unlock (&metrics_lock);
905 iter = c_avl_get_iterator (metrics_tree);
906 while (c_avl_iterator_next (iter, (void *) &name, (void *) &metric) == 0)
908 if ((metric->updates_num == 0)
909 && ((conf_delete_counters && (metric->type == STATSD_COUNTER))
910 || (conf_delete_timers && (metric->type == STATSD_TIMER))
911 || (conf_delete_gauges && (metric->type == STATSD_GAUGE))
912 || (conf_delete_sets && (metric->type == STATSD_SET))))
914 DEBUG ("statsd plugin: Deleting metric \"%s\".", name);
915 strarray_add (&to_be_deleted, &to_be_deleted_num, name);
919 /* Names have a prefix, e.g. "c:", which determines the (statsd) type.
920 * Remove this here. */
921 statsd_metric_submit_unsafe (name + 2, metric);
923 /* Reset the metric. */
924 metric->updates_num = 0;
925 if (metric->type == STATSD_SET)
926 statsd_metric_clear_set_unsafe (metric);
928 c_avl_iterator_destroy (iter);
930 for (i = 0; i < to_be_deleted_num; i++)
934 status = c_avl_remove (metrics_tree, to_be_deleted[i],
935 (void *) &name, (void *) &metric);
938 ERROR ("stats plugin: c_avl_remove (\"%s\") failed with status %i.",
939 to_be_deleted[i], status);
944 statsd_metric_free (metric);
947 pthread_mutex_unlock (&metrics_lock);
949 strarray_free (to_be_deleted, to_be_deleted_num);
952 } /* }}} int statsd_read */
954 static int statsd_shutdown (void) /* {{{ */
959 pthread_mutex_lock (&metrics_lock);
961 if (network_thread_running)
963 network_thread_shutdown = 1;
964 pthread_kill (network_thread, SIGTERM);
965 pthread_join (network_thread, /* retval = */ NULL);
967 network_thread_running = 0;
969 while (c_avl_pick (metrics_tree, &key, &value) == 0)
972 statsd_metric_free (value);
974 c_avl_destroy (metrics_tree);
978 sfree (conf_service);
980 pthread_mutex_unlock (&metrics_lock);
983 } /* }}} int statsd_shutdown */
985 void module_register (void)
987 plugin_register_complex_config ("statsd", statsd_config);
988 plugin_register_init ("statsd", statsd_init);
989 plugin_register_read ("statsd", statsd_read);
990 plugin_register_shutdown ("statsd", statsd_shutdown);
993 /* vim: set sw=2 sts=2 et fdm=marker : */