DEBUG ("amqp plugin: Shutting down %zu subscriber threads.",
subscriber_threads_num);
subscriber_threads_running = 0;
DEBUG ("amqp plugin: Shutting down %zu subscriber threads.",
subscriber_threads_num);
subscriber_threads_running = 0;
{
/* FIXME: Sending a signal is not very elegant here. Maybe find out how
* to use a timeout in the thread and check for the variable in regular
{
/* FIXME: Sending a signal is not very elegant here. Maybe find out how
* to use a timeout in the thread and check for the variable in regular
ERROR ("amqp plugin: camqp_connect failed. "
"Will sleep for %.3f seconds.",
CDTIME_T_TO_DOUBLE (interval));
ERROR ("amqp plugin: camqp_connect failed. "
"Will sleep for %.3f seconds.",
CDTIME_T_TO_DOUBLE (interval));
- CDTIME_T_TO_TIMESPEC (interval, &ts_interval);
- nanosleep (&ts_interval, /* remaining = */ NULL);
+ nanosleep (&CDTIME_T_TO_TIMESPEC (interval), /* remaining = */ NULL);
ERROR ("amqp plugin: amqp_simple_wait_frame failed. "
"Will sleep for %.3f seconds.",
CDTIME_T_TO_DOUBLE (interval));
camqp_close_connection (conf);
ERROR ("amqp plugin: amqp_simple_wait_frame failed. "
"Will sleep for %.3f seconds.",
CDTIME_T_TO_DOUBLE (interval));
camqp_close_connection (conf);
- CDTIME_T_TO_TIMESPEC (interval, &ts_interval);
- nanosleep (&ts_interval, /* remaining = */ NULL);
+ nanosleep (&CDTIME_T_TO_TIMESPEC (interval), /* remaining = */ NULL);
memset (tmp, 0, sizeof (*tmp));
status = plugin_thread_create (tmp, /* attr = */ NULL,
memset (tmp, 0, sizeof (*tmp));
status = plugin_thread_create (tmp, /* attr = */ NULL,
ssnprintf (routing_key, sizeof (routing_key), "collectd/%s/%s/%s/%s/%s",
vl->host,
vl->plugin, vl->plugin_instance,
ssnprintf (routing_key, sizeof (routing_key), "collectd/%s/%s/%s/%s/%s",
vl->host,
vl->plugin, vl->plugin_instance,
/* Switch slashes (the only character forbidden by collectd) and dots
* (the separation character used by AMQP). */
/* Switch slashes (the only character forbidden by collectd) and dots
* (the separation character used by AMQP). */
- status = create_putval (buffer, sizeof (buffer), ds, vl);
+ status = cmd_create_putval (buffer, sizeof (buffer), ds, vl);
ssnprintf (cbname, sizeof (cbname), "amqp/%s", conf->name);
ssnprintf (cbname, sizeof (cbname), "amqp/%s", conf->name);
- status = plugin_register_write (cbname, camqp_write, &ud);
+ status = plugin_register_write (cbname, camqp_write,
+ &(user_data_t) {
+ .data = conf,
+ .free_func = camqp_config_free,
+ });