author | Florian Forster <octo@collectd.org> | |
Fri, 16 Nov 2012 06:53:27 +0000 (07:53 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Fri, 16 Nov 2012 06:55:52 +0000 (07:55 +0100) |
Conflicts:
src/amqp.c
src/exec.c
src/memcached.c
src/unixsock.c
src/amqp.c
src/exec.c
src/memcached.c
src/unixsock.c
19 files changed:
diff --cc src/amqp.c
index c9e46c45df0cac7ef0e0cc4f3bdd2e1bda8ad96e,db65791626c69c0faf6b9e8feff87269a8f29f95..9c8c6e537c6cb1d2f3907402f7c602e2f8b326b6
--- 1/src/amqp.c
--- 2/src/amqp.c
+++ b/src/amqp.c
status = camqp_connect (conf);
if (status != 0)
{
+ struct timespec ts_interval;
ERROR ("amqp plugin: camqp_connect failed. "
"Will sleep for %.3f seconds.",
- CDTIME_T_TO_DOUBLE (interval_g));
- CDTIME_T_TO_TIMESPEC (interval_g, &ts_interval);
+ CDTIME_T_TO_DOUBLE (interval));
- sleep (interval);
++ CDTIME_T_TO_TIMESPEC (interval, &ts_interval);
+ nanosleep (&ts_interval, /* remaining = */ NULL);
continue;
}
status = amqp_simple_wait_frame (conf->connection, &frame);
if (status < 0)
{
+ struct timespec ts_interval;
ERROR ("amqp plugin: amqp_simple_wait_frame failed. "
"Will sleep for %.3f seconds.",
- CDTIME_T_TO_DOUBLE (interval_g));
+ CDTIME_T_TO_DOUBLE (interval));
camqp_close_connection (conf);
- CDTIME_T_TO_TIMESPEC (interval_g, &ts_interval);
- sleep (interval);
++ CDTIME_T_TO_TIMESPEC (interval, &ts_interval);
+ nanosleep (&ts_interval, /* remaining = */ NULL);
continue;
}
diff --cc src/collectd.c
Simple merge
diff --cc src/collectd.conf.pod
Simple merge
diff --cc src/configfile.c
Simple merge
diff --cc src/configfile.h
Simple merge
diff --cc src/disk.c
index 375583c432418dd355a4eafe753a849a0cc18ba2,fde0dcde9abd5112c48633a6dcd588ef8bb0f69b..3728d556531619bcdf093ca758fbcf0b88fe71b2
--- 1/src/disk.c
--- 2/src/disk.c
+++ b/src/disk.c
plugin_dispatch_values (&vl);
} /* void disk_submit */
- double avg_time_incr = CDTIME_T_TO_DOUBLE (interval_g) * avg_time;
+#if KERNEL_LINUX
+static counter_t disk_calc_time_incr (counter_t delta_time, counter_t delta_ops)
+{
++ double interval = CDTIME_T_TO_DOUBLE (plugin_get_interval ());
+ double avg_time = ((double) delta_time) / ((double) delta_ops);
++ double avg_time_incr = interval * avg_time;
+
+ return ((counter_t) (avg_time_incr + .5));
+}
+#endif
+
#if HAVE_IOKIT_IOKITLIB_H
static signed long long dict_get_value (CFDictionaryRef dict, const char *key)
{
diff --cc src/email.c
Simple merge
diff --cc src/exec.c
index 0e807c75bc18e7dc59547471b3c35c57915979ac,da6e367d633dc3019849c65028c4ad89946dbb9f..14d288f1f419f78df74f26fd2b9b10afcbfe63d5
--- 1/src/exec.c
--- 2/src/exec.c
+++ b/src/exec.c
pthread_attr_init (&attr);
pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
- pthread_create (&t, &attr, exec_read_one, (void *) pl);
+ plugin_thread_create (&t, &attr, exec_read_one, (void *) pl);
+ pthread_attr_destroy (&attr);
} /* for (pl) */
return (0);
pthread_attr_init (&attr);
pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
- pthread_create (&t, &attr, exec_notification_one, (void *) pln);
+ plugin_thread_create (&t, &attr, exec_notification_one, (void *) pln);
+ pthread_attr_destroy (&attr);
} /* for (pl) */
return (0);
diff --cc src/network.c
Simple merge
diff --cc src/perl.c
Simple merge
diff --cc src/pinba.c
Simple merge
diff --cc src/ping.c
Simple merge
diff --cc src/plugin.c
Simple merge
diff --cc src/plugin.h
Simple merge
diff --cc src/postgresql.c
index 675505bb3576919d741a3c31bb86fac5e6acce08,953bcd83e6a3f2f2feae58768670e42d3dd4b47a..a72109aebc29d838211423c7c2ebd8a0559ca6d0
--- 1/src/postgresql.c
--- 2/src/postgresql.c
+++ b/src/postgresql.c
case C_PSQL_PARAM_INTERVAL:
ssnprintf (interval, sizeof (interval), "%.3f",
(db->interval > 0)
- ? CDTIME_T_TO_DOUBLE (db->interval) : interval_g);
+ ? CDTIME_T_TO_DOUBLE (db->interval)
+ : plugin_get_interval ());
params[i] = interval;
break;
+ case C_PSQL_PARAM_INSTANCE:
+ params[i] = db->instance;
+ break;
default:
assert (0);
}
diff --cc src/python.c
Simple merge
diff --cc src/rrdtool.c
Simple merge
diff --cc src/snmp.c
Simple merge
diff --cc src/unixsock.c
index 0dc7d659400193a8bf29fc0ab3f78a9556826a90,337978df444e17ac5dbccdbf88ad7d71330024fd..2c1665fc9fcbbdffc3c91935838a720e4fbf6d6f
--- 1/src/unixsock.c
--- 2/src/unixsock.c
+++ b/src/unixsock.c
DEBUG ("Spawning child to handle connection on fd #%i", *remote_fd);
- status = pthread_create (&th, &th_attr, us_handle_client, (void *) remote_fd);
- pthread_attr_init (&th_attr);
- pthread_attr_setdetachstate (&th_attr, PTHREAD_CREATE_DETACHED);
-
+ status = plugin_thread_create (&th, &th_attr,
+ us_handle_client, (void *) remote_fd);
if (status != 0)
{
char errbuf[1024];