Merge remote-tracking branch 'github/pr/2027' into collectd-5.5
authorFlorian Forster <octo@collectd.org>
Sun, 6 Nov 2016 19:40:36 +0000 (20:40 +0100)
committerFlorian Forster <octo@collectd.org>
Sun, 6 Nov 2016 19:40:36 +0000 (20:40 +0100)
src/write_riemann.c
src/write_riemann_threshold.c
src/write_riemann_threshold.h

index 58611a9..a6effa3 100644 (file)
  *   Florian octo Forster <octo at collectd.org>
  */
 
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#include <errno.h>
-#include <netdb.h>
-#include <inttypes.h>
-#include <pthread.h>
-
 #include "collectd.h"
+
 #include "plugin.h"
 #include "common.h"
 #include "configfile.h"
 #include "riemann.pb-c.h"
 #include "write_riemann_threshold.h"
 
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+
 #define RIEMANN_HOST           "localhost"
 #define RIEMANN_PORT           "5555"
-#define RIEMANN_TTL_FACTOR      2.0
-#define RIEMANN_BATCH_MAX      8192
+#define RIEMANN_TTL_FACTOR     2.0
+#define RIEMANN_BATCH_MAX      8192
 
 struct riemann_host {
        char                    *name;
index b1f7297..4009366 100644 (file)
  *   Andrés J. Díaz <ajdiaz at connectical.com>
  **/
 
-#include <assert.h>
-#include <ltdl.h>
-#include <pthread.h>
-
 #include "collectd.h"
+
 #include "common.h"
 #include "plugin.h"
 #include "utils_avltree.h"
@@ -37,6 +34,8 @@
 #include "utils_threshold.h"
 #include "write_riemann_threshold.h"
 
+#include <ltdl.h>
+
 /*
  * Threshold management
  * ====================
index d3b3fe9..bae2b2a 100644 (file)
@@ -1,6 +1,36 @@
+/**
+ * collectd - src/write_riemann_threshold.h
+ * Copyright (C) 2016       Ruben Kerkhof
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; only version 2 of the License is applicable.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ *
+ * Author:
+ *   Ruben Kerkhof <ruben at rubenkerkhof.com>
+ **/
+
 #ifndef WRITE_RIEMANN_THRESHOLD_H
 #define WRITE_RIEMANN_THRESHOLD_H
 
-int write_riemann_threshold_check(const data_set_t *, const value_list_t *, int *);
+#include "plugin.h"
+
+/* write_riemann_threshold_check tests all matching thresholds and returns the
+ * worst result for each data source in "statuses". "statuses" must point to
+ * ds->ds_num integers to which the result is written.
+ *
+ * Returns zero on success and if no threshold has been configured. Returns
+ * less than zero on failure. */
+int write_riemann_threshold_check(const data_set_t *ds, const value_list_t *vl,
+    int *statuses);
 
-#endif
+#endif /* WRITE_RIEMANN_THRESHOLD_H */