summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c8549bc)
raw | patch | inline | side by side (parent: c8549bc)
author | Yves Mettier <ymettier@free.fr> | |
Tue, 26 Aug 2014 11:02:49 +0000 (13:02 +0200) | ||
committer | Yves Mettier <ymettier@free.fr> | |
Tue, 26 Aug 2014 11:02:49 +0000 (13:02 +0200) |
src/collectd.conf.in | patch | blob | history | |
src/collectd.conf.pod | patch | blob | history | |
src/configfile.c | patch | blob | history | |
src/plugin.c | patch | blob | history |
diff --git a/src/collectd.conf.in b/src/collectd.conf.in
index f4a31129eb32ea26dac2fbbc77f9d59f9ab3f818..1c051a0690453ed5988512d6c7f429414bfb14d5 100644 (file)
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
# When enabled, some internal statistics are recorded as values #
# Disabled by default. #
#----------------------------------------------------------------------------#
-#InternalStatistics false
+#CollectInternalStats false
#----------------------------------------------------------------------------#
# Interval at which to query values. This may be overwritten on a per-plugin #
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index ba9b6cae89007fc5bf29635db658d51b86f7f3bd..f379ccae7f90ab974c826adfa36019272c757bc5 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
the I<Threshold> configuration to dispatch notifications about missing values,
see L<collectd-threshold(5)> for details.
-=item B<InternalStatistics> I<true|false>
+=item B<CollectInternalStats> I<true|false>
Some internal statistics can be recorded to monitor Collectd itself.
Default value : false.
diff --git a/src/configfile.c b/src/configfile.c
index c099970940eee115f8bfca0c3594127060491fc7..2eaaad1af4bbcae01e795cfbb478b3838c50b579 100644 (file)
--- a/src/configfile.c
+++ b/src/configfile.c
{"WriteQueueLimitLow", NULL, NULL},
{"Timeout", NULL, "2"},
{"AutoLoadPlugin", NULL, "false"},
- {"InternalStatistics", NULL, "false"},
+ {"CollectInternalStats", NULL, "false"},
{"PreCacheChain", NULL, "PreCache"},
{"PostCacheChain", NULL, "PostCache"}
};
diff --git a/src/plugin.c b/src/plugin.c
index 0b9156134df9c0c93ea06357460e71b60030c55d..ce2fb553c977219f5c71db5c41c782cabcedcf2f 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
vl.values_len = 2;
vl.time = 0;
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
- sstrncpy (vl.plugin, "internal", sizeof (vl.plugin));
+ sstrncpy (vl.plugin, "collectd", sizeof (vl.plugin));
vl.type_instance[0] = 0;
vl.values_len = 1;
/* Init the value cache */
uc_init ();
- if (IS_TRUE (global_option_get ("InternalStatistics")))
+ if (IS_TRUE (global_option_get ("CollectInternalStats")))
record_statistics = 1;
chain_name = global_option_get ("PreCacheChain");
static pthread_mutex_t statistics_lock = PTHREAD_MUTEX_INITIALIZER;
if (check_drop_value ()) {
- pthread_mutex_lock(&statistics_lock);
- stats_values_dropped++;
- pthread_mutex_unlock(&statistics_lock);
+ if(record_statistics) {
+ pthread_mutex_lock(&statistics_lock);
+ stats_values_dropped++;
+ pthread_mutex_unlock(&statistics_lock);
+ }
return (0);
}