From 02a570b9e233010777e502db11e569cc4f40984c Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 30 Oct 2010 14:03:02 +0200 Subject: [PATCH] Various plugins: Don't call "time(2)" in the plugins to set vl.time. vl.time is initialized to zero instead and the current time is filled in by dispatch_values(). --- src/curl.c | 2 -- src/memcachec.c | 1 - src/memcached.c | 3 --- src/ted.c | 1 - 4 files changed, 7 deletions(-) diff --git a/src/curl.c b/src/curl.c index a533e147..8b95c80f 100644 --- a/src/curl.c +++ b/src/curl.c @@ -577,7 +577,6 @@ static void cc_submit (const web_page_t *wp, const web_match_t *wm, /* {{{ */ vl.values = values; vl.values_len = 1; - vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "curl", sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, wp->instance, sizeof (vl.plugin_instance)); @@ -596,7 +595,6 @@ static void cc_submit_response_time (const web_page_t *wp, double seconds) /* {{ vl.values = values; vl.values_len = 1; - vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "curl", sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, wp->instance, sizeof (vl.plugin_instance)); diff --git a/src/memcachec.c b/src/memcachec.c index d066501c..8f51e22f 100644 --- a/src/memcachec.c +++ b/src/memcachec.c @@ -452,7 +452,6 @@ static void cmc_submit (const web_page_t *wp, const web_match_t *wm, /* {{{ */ vl.values = values; vl.values_len = 1; - vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "memcachec", sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, wp->instance, sizeof (vl.plugin_instance)); diff --git a/src/memcached.c b/src/memcached.c index 348591fd..8490bf66 100644 --- a/src/memcached.c +++ b/src/memcached.c @@ -302,7 +302,6 @@ static void submit_counter2 (const char *type, const char *type_inst, vl.values = values; vl.values_len = 2; - vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "memcached", sizeof (vl.plugin)); sstrncpy (vl.type, type, sizeof (vl.type)); @@ -323,7 +322,6 @@ static void submit_gauge (const char *type, const char *type_inst, vl.values = values; vl.values_len = 1; - vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "memcached", sizeof (vl.plugin)); sstrncpy (vl.type, type, sizeof (vl.type)); @@ -345,7 +343,6 @@ static void submit_gauge2 (const char *type, const char *type_inst, vl.values = values; vl.values_len = 2; - vl.time = time (NULL); sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "memcached", sizeof (vl.plugin)); sstrncpy (vl.type, type, sizeof (vl.type)); diff --git a/src/ted.c b/src/ted.c index 8dc00e5a..bf519bbe 100644 --- a/src/ted.c +++ b/src/ted.c @@ -271,7 +271,6 @@ static void ted_submit (char *type, double value) values[0].gauge = value; - vl.time = time (NULL); vl.values = values; vl.values_len = 1; sstrncpy (vl.host, hostname_g, sizeof (vl.host)); -- 2.11.0