author | Florian Forster <octo@huhu.verplant.org> | |
Sat, 22 Mar 2008 08:41:42 +0000 (09:41 +0100) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Sat, 22 Mar 2008 08:41:42 +0000 (09:41 +0100) |
Conflicts:
src/utils_cache.c
src/utils_cache.c
1 | 2 | |||
---|---|---|---|---|
configure.in | patch | | diff1 | | diff2 | | blob | history |
src/collectd.conf.pod | patch | | diff1 | | diff2 | | blob | history |
src/network.c | patch | | diff1 | | diff2 | | blob | history |
src/plugin.c | patch | | diff1 | | diff2 | | blob | history |
src/unixsock.c | patch | | diff1 | | diff2 | | blob | history |
src/utils_cache.c | patch | | diff1 | | diff2 | | blob | history |
src/utils_cache.h | patch | | diff1 | | diff2 | | blob | history |
diff --cc configure.in
Simple merge
diff --cc src/collectd.conf.pod
Simple merge
diff --cc src/network.c
Simple merge
diff --cc src/plugin.c
Simple merge
diff --cc src/unixsock.c
Simple merge
diff --cc src/utils_cache.c
index ad8fb199f175e02e39625df41ecf82abfb559abd,b9b896215be1cb631f5c1b0252bcf4c341af6846..c471ee28d29e1f87bf6a38a856debb932b7bf1c2
--- 1/src/utils_cache.c
--- 2/src/utils_cache.c
+++ b/src/utils_cache.c
pthread_mutex_unlock (&cache_lock);
+ if (send_okay_notification == 0)
+ return (0);
+
/* Do not send okay notifications for uninteresting values, i. e. values for
* which no threshold is configured. */
- if (send_okay_notification > 0)
- {
- int status;
-
- status = ut_check_interesting (name);
- if (status <= 0)
- send_okay_notification = 0;
- }
-
- if (send_okay_notification > 0)
- {
- notification_t n;
- memset (&n, '\0', sizeof (n));
+ status = ut_check_interesting (name);
+ if (status <= 0)
+ return (0);
- /* Copy the associative members */
- NOTIFICATION_INIT_VL (&n, vl, ds);
+ /* Initialize the notification */
+ memset (&n, '\0', sizeof (n));
+ NOTIFICATION_INIT_VL (&n, vl, ds);
- n.severity = NOTIF_OKAY;
- n.time = vl->time;
+ n.severity = NOTIF_OKAY;
+ n.time = vl->time;
- snprintf (n.message, sizeof (n.message),
- "Received a value for %s. It was missing for %i seconds.",
- name, send_okay_notification);
- n.message[sizeof (n.message) - 1] = '\0';
+ snprintf (n.message, sizeof (n.message),
+ "Received a value for %s. It was missing for %u seconds.",
+ name, (unsigned int) update_delay);
+ n.message[sizeof (n.message) - 1] = '\0';
- plugin_dispatch_notification (&n);
- }
+ plugin_dispatch_notification (&n);
return (0);
- } /* int uc_insert */
+ } /* int uc_update */
-gauge_t *uc_get_rate (const data_set_t *ds, const value_list_t *vl)
+int uc_get_rate_by_name (const char *name, gauge_t **ret_values, size_t *ret_values_num)
{
- char name[6 * DATA_MAX_NAME_LEN];
gauge_t *ret = NULL;
+ size_t ret_num = 0;
cache_entry_t *ce = NULL;
+ int status = 0;
+ if (FORMAT_VL (name, sizeof (name), vl, ds) != 0)
+ {
+ ERROR ("uc_get_rate: FORMAT_VL failed.");
+ return (NULL);
+ }
+
pthread_mutex_lock (&cache_lock);
if (c_avl_get (cache_tree, name, (void *) &ce) == 0)
diff --cc src/utils_cache.h
Simple merge