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_latency.h"
34 #include <sys/types.h>
38 /* AIX doesn't have MSG_DONTWAIT */
40 # define MSG_DONTWAIT MSG_NONBLOCK
43 #ifndef STATSD_DEFAULT_NODE
44 # define STATSD_DEFAULT_NODE NULL
47 #ifndef STATSD_DEFAULT_SERVICE
48 # define STATSD_DEFAULT_SERVICE "8125"
58 typedef enum metric_type_e metric_type_t;
60 struct statsd_metric_s
65 latency_counter_t *latency;
67 unsigned long updates_num;
69 typedef struct statsd_metric_s statsd_metric_t;
71 static c_avl_tree_t *metrics_tree = NULL;
72 static pthread_mutex_t metrics_lock = PTHREAD_MUTEX_INITIALIZER;
74 static pthread_t network_thread;
75 static _Bool network_thread_running = 0;
76 static _Bool network_thread_shutdown = 0;
78 static char *conf_node = NULL;
79 static char *conf_service = NULL;
81 static _Bool conf_delete_counters = 0;
82 static _Bool conf_delete_timers = 0;
83 static _Bool conf_delete_gauges = 0;
84 static _Bool conf_delete_sets = 0;
86 static double *conf_timer_percentile = NULL;
87 static size_t conf_timer_percentile_num = 0;
89 static _Bool conf_counter_sum = 0;
90 static _Bool conf_timer_lower = 0;
91 static _Bool conf_timer_upper = 0;
92 static _Bool conf_timer_sum = 0;
93 static _Bool conf_timer_count = 0;
95 /* Must hold metrics_lock when calling this function. */
96 static statsd_metric_t *statsd_metric_lookup_unsafe (char const *name, /* {{{ */
99 char key[DATA_MAX_NAME_LEN + 2];
101 statsd_metric_t *metric;
106 case STATSD_COUNTER: key[0] = 'c'; break;
107 case STATSD_TIMER: key[0] = 't'; break;
108 case STATSD_GAUGE: key[0] = 'g'; break;
109 case STATSD_SET: key[0] = 's'; break;
110 default: return (NULL);
114 sstrncpy (&key[2], name, sizeof (key) - 2);
116 status = c_avl_get (metrics_tree, key, (void *) &metric);
120 key_copy = strdup (key);
121 if (key_copy == NULL)
123 ERROR ("statsd plugin: strdup failed.");
127 metric = calloc (1, sizeof (*metric));
130 ERROR ("statsd plugin: calloc failed.");
136 metric->latency = NULL;
139 status = c_avl_insert (metrics_tree, key_copy, metric);
142 ERROR ("statsd plugin: c_avl_insert failed.");
149 } /* }}} statsd_metric_lookup_unsafe */
151 static int statsd_metric_set (char const *name, double value, /* {{{ */
154 statsd_metric_t *metric;
156 pthread_mutex_lock (&metrics_lock);
158 metric = statsd_metric_lookup_unsafe (name, type);
161 pthread_mutex_unlock (&metrics_lock);
165 metric->value = value;
166 metric->updates_num++;
168 pthread_mutex_unlock (&metrics_lock);
171 } /* }}} int statsd_metric_set */
173 static int statsd_metric_add (char const *name, double delta, /* {{{ */
176 statsd_metric_t *metric;
178 pthread_mutex_lock (&metrics_lock);
180 metric = statsd_metric_lookup_unsafe (name, type);
183 pthread_mutex_unlock (&metrics_lock);
187 metric->value += delta;
188 metric->updates_num++;
190 pthread_mutex_unlock (&metrics_lock);
193 } /* }}} int statsd_metric_add */
195 static void statsd_metric_free (statsd_metric_t *metric) /* {{{ */
200 if (metric->latency != NULL)
202 latency_counter_destroy (metric->latency);
203 metric->latency = NULL;
206 if (metric->set != NULL)
211 while (c_avl_pick (metric->set, &key, &value) == 0)
214 assert (value == NULL);
217 c_avl_destroy (metric->set);
222 } /* }}} void statsd_metric_free */
224 static int statsd_parse_value (char const *str, value_t *ret_value) /* {{{ */
228 ret_value->gauge = (gauge_t) strtod (str, &endptr);
229 if ((str == endptr) || ((endptr != NULL) && (*endptr != 0)))
233 } /* }}} int statsd_parse_value */
235 static int statsd_handle_counter (char const *name, /* {{{ */
236 char const *value_str,
243 if ((extra != NULL) && (extra[0] != '@'))
249 status = statsd_parse_value (extra + 1, &scale);
253 if (!isfinite (scale.gauge) || (scale.gauge <= 0.0) || (scale.gauge > 1.0))
258 status = statsd_parse_value (value_str, &value);
262 /* Changes to the counter are added to (statsd_metric_t*)->value. ->counter is
263 * only updated in statsd_metric_submit_unsafe(). */
264 return (statsd_metric_add (name, (double) (value.gauge / scale.gauge),
266 } /* }}} int statsd_handle_counter */
268 static int statsd_handle_gauge (char const *name, /* {{{ */
269 char const *value_str)
275 status = statsd_parse_value (value_str, &value);
279 if ((value_str[0] == '+') || (value_str[0] == '-'))
280 return (statsd_metric_add (name, (double) value.gauge, STATSD_GAUGE));
282 return (statsd_metric_set (name, (double) value.gauge, STATSD_GAUGE));
283 } /* }}} int statsd_handle_gauge */
285 static int statsd_handle_timer (char const *name, /* {{{ */
286 char const *value_str,
289 statsd_metric_t *metric;
295 if ((extra != NULL) && (extra[0] != '@'))
301 status = statsd_parse_value (extra + 1, &scale);
305 if (!isfinite (scale.gauge) || (scale.gauge <= 0.0) || (scale.gauge > 1.0))
310 status = statsd_parse_value (value_str, &value_ms);
314 value = MS_TO_CDTIME_T (value_ms.gauge / scale.gauge);
316 pthread_mutex_lock (&metrics_lock);
318 metric = statsd_metric_lookup_unsafe (name, STATSD_TIMER);
321 pthread_mutex_unlock (&metrics_lock);
325 if (metric->latency == NULL)
326 metric->latency = latency_counter_create ();
327 if (metric->latency == NULL)
329 pthread_mutex_unlock (&metrics_lock);
333 latency_counter_add (metric->latency, value);
334 metric->updates_num++;
336 pthread_mutex_unlock (&metrics_lock);
338 } /* }}} int statsd_handle_timer */
340 static int statsd_handle_set (char const *name, /* {{{ */
341 char const *set_key_orig)
343 statsd_metric_t *metric = NULL;
347 pthread_mutex_lock (&metrics_lock);
349 metric = statsd_metric_lookup_unsafe (name, STATSD_SET);
352 pthread_mutex_unlock (&metrics_lock);
356 /* Make sure metric->set exists. */
357 if (metric->set == NULL)
358 metric->set = c_avl_create ((int (*) (const void *, const void *)) strcmp);
360 if (metric->set == NULL)
362 pthread_mutex_unlock (&metrics_lock);
363 ERROR ("statsd plugin: c_avl_create failed.");
367 set_key = strdup (set_key_orig);
370 pthread_mutex_unlock (&metrics_lock);
371 ERROR ("statsd plugin: strdup failed.");
375 status = c_avl_insert (metric->set, set_key, /* value = */ NULL);
378 pthread_mutex_unlock (&metrics_lock);
380 ERROR ("statsd plugin: c_avl_insert (\"%s\") failed with status %i.",
385 else if (status > 0) /* key already exists */
390 metric->updates_num++;
392 pthread_mutex_unlock (&metrics_lock);
394 } /* }}} int statsd_handle_set */
396 static int statsd_parse_line (char *buffer) /* {{{ */
403 type = strchr (name, '|');
409 value = strrchr (name, ':');
415 extra = strchr (type, '|');
422 if (strcmp ("c", type) == 0)
423 return (statsd_handle_counter (name, value, extra));
424 else if (strcmp ("ms", type) == 0)
425 return (statsd_handle_timer (name, value, extra));
427 /* extra is only valid for counters and timers */
431 if (strcmp ("g", type) == 0)
432 return (statsd_handle_gauge (name, value));
433 else if (strcmp ("s", type) == 0)
434 return (statsd_handle_set (name, value));
437 } /* }}} void statsd_parse_line */
439 static void statsd_parse_buffer (char *buffer) /* {{{ */
441 while (buffer != NULL)
447 next = strchr (buffer, '\n');
460 sstrncpy (orig, buffer, sizeof (orig));
462 status = statsd_parse_line (buffer);
464 ERROR ("statsd plugin: Unable to parse line: \"%s\"", orig);
468 } /* }}} void statsd_parse_buffer */
470 static void statsd_network_read (int fd) /* {{{ */
476 status = recv (fd, buffer, sizeof (buffer), /* flags = */ MSG_DONTWAIT);
481 if ((errno == EAGAIN) || (errno == EWOULDBLOCK))
484 ERROR ("statsd plugin: recv(2) failed: %s",
485 sstrerror (errno, errbuf, sizeof (errbuf)));
489 buffer_size = (size_t) status;
490 if (buffer_size >= sizeof (buffer))
491 buffer_size = sizeof (buffer) - 1;
492 buffer[buffer_size] = 0;
494 statsd_parse_buffer (buffer);
495 } /* }}} void statsd_network_read */
497 static int statsd_network_init (struct pollfd **ret_fds, /* {{{ */
500 struct pollfd *fds = NULL;
503 struct addrinfo ai_hints;
504 struct addrinfo *ai_list = NULL;
505 struct addrinfo *ai_ptr;
508 char const *node = (conf_node != NULL) ? conf_node : STATSD_DEFAULT_NODE;
509 char const *service = (conf_service != NULL)
510 ? conf_service : STATSD_DEFAULT_SERVICE;
512 memset (&ai_hints, 0, sizeof (ai_hints));
513 ai_hints.ai_flags = AI_PASSIVE;
515 ai_hints.ai_flags |= AI_ADDRCONFIG;
517 ai_hints.ai_family = AF_UNSPEC;
518 ai_hints.ai_socktype = SOCK_DGRAM;
520 status = getaddrinfo (node, service, &ai_hints, &ai_list);
523 ERROR ("statsd plugin: getaddrinfo (\"%s\", \"%s\") failed: %s",
524 node, service, gai_strerror (status));
528 for (ai_ptr = ai_list; ai_ptr != NULL; ai_ptr = ai_ptr->ai_next)
533 char dbg_node[NI_MAXHOST];
534 char dbg_service[NI_MAXSERV];
536 fd = socket (ai_ptr->ai_family, ai_ptr->ai_socktype, ai_ptr->ai_protocol);
540 ERROR ("statsd plugin: socket(2) failed: %s",
541 sstrerror (errno, errbuf, sizeof (errbuf)));
545 getnameinfo (ai_ptr->ai_addr, ai_ptr->ai_addrlen,
546 dbg_node, sizeof (dbg_node), dbg_service, sizeof (dbg_service),
547 NI_DGRAM | NI_NUMERICHOST | NI_NUMERICSERV);
548 DEBUG ("statsd plugin: Trying to bind to [%s]:%s ...", dbg_node, dbg_service);
550 status = bind (fd, ai_ptr->ai_addr, ai_ptr->ai_addrlen);
554 ERROR ("statsd plugin: bind(2) failed: %s",
555 sstrerror (errno, errbuf, sizeof (errbuf)));
560 tmp = realloc (fds, sizeof (*fds) * (fds_num + 1));
563 ERROR ("statsd plugin: realloc failed.");
571 memset (tmp, 0, sizeof (*tmp));
573 tmp->events = POLLIN | POLLPRI;
576 freeaddrinfo (ai_list);
580 ERROR ("statsd plugin: Unable to create listening socket for [%s]:%s.",
581 (node != NULL) ? node : "::", service);
586 *ret_fds_num = fds_num;
588 } /* }}} int statsd_network_init */
590 static void *statsd_network_thread (void *args) /* {{{ */
592 struct pollfd *fds = NULL;
597 status = statsd_network_init (&fds, &fds_num);
600 ERROR ("statsd plugin: Unable to open listening sockets.");
601 pthread_exit ((void *) 0);
604 while (!network_thread_shutdown)
606 status = poll (fds, (nfds_t) fds_num, /* timeout = */ -1);
611 if ((errno == EINTR) || (errno == EAGAIN))
614 ERROR ("statsd plugin: poll(2) failed: %s",
615 sstrerror (errno, errbuf, sizeof (errbuf)));
619 for (i = 0; i < fds_num; i++)
621 if ((fds[i].revents & (POLLIN | POLLPRI)) == 0)
624 statsd_network_read (fds[i].fd);
627 } /* while (!network_thread_shutdown) */
630 for (i = 0; i < fds_num; i++)
635 } /* }}} void *statsd_network_thread */
637 static int statsd_config_timer_percentile (oconfig_item_t *ci) /* {{{ */
639 double percent = NAN;
643 status = cf_util_get_double (ci, &percent);
647 if ((percent <= 0.0) || (percent >= 100))
649 ERROR ("statsd plugin: The value for \"%s\" must be between 0 and 100, "
650 "exclusively.", ci->key);
654 tmp = realloc (conf_timer_percentile,
655 sizeof (*conf_timer_percentile) * (conf_timer_percentile_num + 1));
658 ERROR ("statsd plugin: realloc failed.");
661 conf_timer_percentile = tmp;
662 conf_timer_percentile[conf_timer_percentile_num] = percent;
663 conf_timer_percentile_num++;
666 } /* }}} int statsd_config_timer_percentile */
668 static int statsd_config (oconfig_item_t *ci) /* {{{ */
672 for (i = 0; i < ci->children_num; i++)
674 oconfig_item_t *child = ci->children + i;
676 if (strcasecmp ("Host", child->key) == 0)
677 cf_util_get_string (child, &conf_node);
678 else if (strcasecmp ("Port", child->key) == 0)
679 cf_util_get_service (child, &conf_service);
680 else if (strcasecmp ("DeleteCounters", child->key) == 0)
681 cf_util_get_boolean (child, &conf_delete_counters);
682 else if (strcasecmp ("DeleteTimers", child->key) == 0)
683 cf_util_get_boolean (child, &conf_delete_timers);
684 else if (strcasecmp ("DeleteGauges", child->key) == 0)
685 cf_util_get_boolean (child, &conf_delete_gauges);
686 else if (strcasecmp ("DeleteSets", child->key) == 0)
687 cf_util_get_boolean (child, &conf_delete_sets);
688 else if (strcasecmp ("CounterSum", child->key) == 0)
689 cf_util_get_boolean (child, &conf_counter_sum);
690 else if (strcasecmp ("TimerLower", child->key) == 0)
691 cf_util_get_boolean (child, &conf_timer_lower);
692 else if (strcasecmp ("TimerUpper", child->key) == 0)
693 cf_util_get_boolean (child, &conf_timer_upper);
694 else if (strcasecmp ("TimerSum", child->key) == 0)
695 cf_util_get_boolean (child, &conf_timer_sum);
696 else if (strcasecmp ("TimerCount", child->key) == 0)
697 cf_util_get_boolean (child, &conf_timer_count);
698 else if (strcasecmp ("TimerPercentile", child->key) == 0)
699 statsd_config_timer_percentile (child);
701 ERROR ("statsd plugin: The \"%s\" config option is not valid.",
706 } /* }}} int statsd_config */
708 static int statsd_init (void) /* {{{ */
710 pthread_mutex_lock (&metrics_lock);
711 if (metrics_tree == NULL)
712 metrics_tree = c_avl_create ((int (*) (const void *, const void *)) strcmp);
714 if (!network_thread_running)
718 status = pthread_create (&network_thread,
720 statsd_network_thread,
725 pthread_mutex_unlock (&metrics_lock);
726 ERROR ("statsd plugin: pthread_create failed: %s",
727 sstrerror (errno, errbuf, sizeof (errbuf)));
731 network_thread_running = 1;
733 pthread_mutex_unlock (&metrics_lock);
736 } /* }}} int statsd_init */
738 /* Must hold metrics_lock when calling this function. */
739 static int statsd_metric_clear_set_unsafe (statsd_metric_t *metric) /* {{{ */
744 if ((metric == NULL) || (metric->type != STATSD_SET))
747 if (metric->set == NULL)
750 while (c_avl_pick (metric->set, &key, &value) == 0)
757 } /* }}} int statsd_metric_clear_set_unsafe */
759 /* Must hold metrics_lock when calling this function. */
760 static int statsd_metric_submit_unsafe (char const *name, statsd_metric_t *metric) /* {{{ */
763 value_list_t vl = VALUE_LIST_INIT;
767 sstrncpy (vl.host, hostname_g, sizeof (vl.host));
768 sstrncpy (vl.plugin, "statsd", sizeof (vl.plugin));
770 if (metric->type == STATSD_GAUGE)
771 sstrncpy (vl.type, "gauge", sizeof (vl.type));
772 else if (metric->type == STATSD_TIMER)
773 sstrncpy (vl.type, "latency", sizeof (vl.type));
774 else if (metric->type == STATSD_SET)
775 sstrncpy (vl.type, "objects", sizeof (vl.type));
776 else /* if (metric->type == STATSD_COUNTER) */
777 sstrncpy (vl.type, "derive", sizeof (vl.type));
779 sstrncpy (vl.type_instance, name, sizeof (vl.type_instance));
781 if (metric->type == STATSD_GAUGE)
782 values[0].gauge = (gauge_t) metric->value;
783 else if (metric->type == STATSD_TIMER)
786 _Bool have_events = (metric->updates_num > 0);
788 /* Make sure all timer metrics share the *same* timestamp. */
791 ssnprintf (vl.type_instance, sizeof (vl.type_instance),
793 values[0].gauge = have_events
794 ? CDTIME_T_TO_DOUBLE (latency_counter_get_average (metric->latency))
796 plugin_dispatch_values (&vl);
798 if (conf_timer_lower) {
799 ssnprintf (vl.type_instance, sizeof (vl.type_instance),
801 values[0].gauge = have_events
802 ? CDTIME_T_TO_DOUBLE (latency_counter_get_min (metric->latency))
804 plugin_dispatch_values (&vl);
807 if (conf_timer_upper) {
808 ssnprintf (vl.type_instance, sizeof (vl.type_instance),
810 values[0].gauge = have_events
811 ? CDTIME_T_TO_DOUBLE (latency_counter_get_max (metric->latency))
813 plugin_dispatch_values (&vl);
816 if (conf_timer_sum) {
817 ssnprintf (vl.type_instance, sizeof (vl.type_instance),
819 values[0].gauge = have_events
820 ? CDTIME_T_TO_DOUBLE (latency_counter_get_sum (metric->latency))
822 plugin_dispatch_values (&vl);
825 for (i = 0; i < conf_timer_percentile_num; i++)
827 ssnprintf (vl.type_instance, sizeof (vl.type_instance),
828 "%s-percentile-%.0f", name, conf_timer_percentile[i]);
829 values[0].gauge = have_events
830 ? CDTIME_T_TO_DOUBLE (latency_counter_get_percentile (metric->latency, conf_timer_percentile[i]))
832 plugin_dispatch_values (&vl);
835 /* Keep this at the end, since vl.type is set to "gauge" here. The
836 * vl.type's above are implicitly set to "latency". */
837 if (conf_timer_count) {
838 sstrncpy (vl.type, "gauge", sizeof (vl.type));
839 ssnprintf (vl.type_instance, sizeof (vl.type_instance),
841 values[0].gauge = latency_counter_get_num (metric->latency);
842 plugin_dispatch_values (&vl);
845 latency_counter_reset (metric->latency);
848 else if (metric->type == STATSD_SET)
850 if (metric->set == NULL)
851 values[0].gauge = 0.0;
853 values[0].gauge = (gauge_t) c_avl_size (metric->set);
855 else { /* STATSD_COUNTER */
856 gauge_t delta = nearbyint (metric->value);
858 /* Etsy's statsd writes counters as two metrics: a rate and the change since
859 * the last write. Since collectd does not reset its DERIVE metrics to zero,
860 * this makes little sense, but we're dispatching a "count" metric here
861 * anyway - if requested by the user - for compatibility reasons. */
862 if (conf_counter_sum)
864 sstrncpy (vl.type, "count", sizeof (vl.type));
865 values[0].gauge = delta;
866 plugin_dispatch_values (&vl);
868 /* restore vl.type */
869 sstrncpy (vl.type, "derive", sizeof (vl.type));
872 /* Rather than resetting value to zero, subtract delta so we correctly keep
873 * track of residuals. */
874 metric->value -= delta;
875 metric->counter += (derive_t) delta;
877 values[0].derive = metric->counter;
880 return (plugin_dispatch_values (&vl));
881 } /* }}} int statsd_metric_submit_unsafe */
883 static int statsd_read (void) /* {{{ */
885 c_avl_iterator_t *iter;
887 statsd_metric_t *metric;
889 char **to_be_deleted = NULL;
890 size_t to_be_deleted_num = 0;
893 pthread_mutex_lock (&metrics_lock);
895 if (metrics_tree == NULL)
897 pthread_mutex_unlock (&metrics_lock);
901 iter = c_avl_get_iterator (metrics_tree);
902 while (c_avl_iterator_next (iter, (void *) &name, (void *) &metric) == 0)
904 if ((metric->updates_num == 0)
905 && ((conf_delete_counters && (metric->type == STATSD_COUNTER))
906 || (conf_delete_timers && (metric->type == STATSD_TIMER))
907 || (conf_delete_gauges && (metric->type == STATSD_GAUGE))
908 || (conf_delete_sets && (metric->type == STATSD_SET))))
910 DEBUG ("statsd plugin: Deleting metric \"%s\".", name);
911 strarray_add (&to_be_deleted, &to_be_deleted_num, name);
915 /* Names have a prefix, e.g. "c:", which determines the (statsd) type.
916 * Remove this here. */
917 statsd_metric_submit_unsafe (name + 2, metric);
919 /* Reset the metric. */
920 metric->updates_num = 0;
921 if (metric->type == STATSD_SET)
922 statsd_metric_clear_set_unsafe (metric);
924 c_avl_iterator_destroy (iter);
926 for (i = 0; i < to_be_deleted_num; i++)
930 status = c_avl_remove (metrics_tree, to_be_deleted[i],
931 (void *) &name, (void *) &metric);
934 ERROR ("stats plugin: c_avl_remove (\"%s\") failed with status %i.",
935 to_be_deleted[i], status);
940 statsd_metric_free (metric);
943 pthread_mutex_unlock (&metrics_lock);
945 strarray_free (to_be_deleted, to_be_deleted_num);
948 } /* }}} int statsd_read */
950 static int statsd_shutdown (void) /* {{{ */
955 if (network_thread_running)
957 network_thread_shutdown = 1;
958 pthread_kill (network_thread, SIGTERM);
959 pthread_join (network_thread, /* retval = */ NULL);
961 network_thread_running = 0;
963 pthread_mutex_lock (&metrics_lock);
965 while (c_avl_pick (metrics_tree, &key, &value) == 0)
968 statsd_metric_free (value);
970 c_avl_destroy (metrics_tree);
974 sfree (conf_service);
976 pthread_mutex_unlock (&metrics_lock);
979 } /* }}} int statsd_shutdown */
981 void module_register (void)
983 plugin_register_complex_config ("statsd", statsd_config);
984 plugin_register_init ("statsd", statsd_init);
985 plugin_register_read ("statsd", statsd_read);
986 plugin_register_shutdown ("statsd", statsd_shutdown);
989 /* vim: set sw=2 sts=2 et fdm=marker : */