summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 73de674)
raw | patch | inline | side by side (parent: 73de674)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Tue, 15 Sep 2015 16:16:07 +0000 (18:16 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Tue, 13 Oct 2015 07:35:51 +0000 (09:35 +0200) |
Print out the value in a debug message. Also emit a warning when it
exceeds the configured Interval.
exceeds the configured Interval.
src/daemon/plugin.c | patch | blob | history |
diff --git a/src/daemon/plugin.c b/src/daemon/plugin.c
index b57dd4a21281a486b3356fe863aeec3fbebc305a..36c1b60ddd9651cc5308d9e285564f7db253c865 100644 (file)
--- a/src/daemon/plugin.c
+++ b/src/daemon/plugin.c
{
read_func_t *rf;
plugin_ctx_t old_ctx;
+ cdtime_t start;
cdtime_t now;
+ cdtime_t elapsed;
int status;
int rf_type;
int rc;
DEBUG ("plugin_read_thread: Handling `%s'.", rf->rf_name);
+ start = cdtime ();
+
old_ctx = plugin_set_ctx (rf->rf_ctx);
if (rf_type == RF_SIMPLE)
/* update the ``next read due'' field */
now = cdtime ();
+ /* calculate the time spent in the read function */
+ elapsed = (now - start);
+
+ if (elapsed > rf->rf_effective_interval)
+ WARNING ("plugin_read_thread: read-function of the `%s' plugin took %.3f "
+ "seconds, which is above its read interval (%.3f seconds). You might "
+ "want to adjust the `Interval' or `ReadThreads' settings.",
+ rf->rf_name, CDTIME_T_TO_DOUBLE(elapsed),
+ CDTIME_T_TO_DOUBLE(rf->rf_effective_interval));
+
+ DEBUG ("plugin_read_thread: read-function of the `%s' plugin took "
+ "%.6f seconds.",
+ rf->rf_name, CDTIME_T_TO_DOUBLE(elapsed));
+
DEBUG ("plugin_read_thread: Effective interval of the "
"%s plugin is %.3f seconds.",
rf->rf_name,