summaryrefslogtreecommitdiffstats
path: root/backends/backends.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-09-03 10:23:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-09-03 10:23:38 +0000
commit574098461cd45be12a497afbdac6f93c58978387 (patch)
tree9eb60a5930b7c20d42f7fde1e234cae3968ed3d9 /backends/backends.h
parentAdding upstream version 1.16.1. (diff)
downloadnetdata-574098461cd45be12a497afbdac6f93c58978387.tar.xz
netdata-574098461cd45be12a497afbdac6f93c58978387.zip
Adding upstream version 1.17.0.upstream/1.17.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'backends/backends.h')
-rw-r--r--backends/backends.h35
1 files changed, 28 insertions, 7 deletions
diff --git a/backends/backends.h b/backends/backends.h
index 8d0bda41..9da04cce 100644
--- a/backends/backends.h
+++ b/backends/backends.h
@@ -16,13 +16,14 @@ typedef enum backend_options {
} BACKEND_OPTIONS;
typedef enum backend_types {
- BACKEND_TYPE_UNKNOWN, //Invalid type
- BACKEND_TYPE_GRAPHITE, //Send plain text to Graphite
- BACKEND_TYPE_OPENTSDB_USING_TELNET, //Send data to OpenTSDB using telnet API
- BACKEND_TYPE_OPENTSDB_USING_HTTP, //Send data to OpenTSDB using HTTP API
- BACKEND_TYPE_JSON, //Stores the data using JSON.
- BACKEND_TYPE_PROMETEUS, //The user selected to use Prometheus backend
- BACKEND_TYPE_KINESIS //Send message to AWS Kinesis
+ BACKEND_TYPE_UNKNOWN, // Invalid type
+ BACKEND_TYPE_GRAPHITE, // Send plain text to Graphite
+ BACKEND_TYPE_OPENTSDB_USING_TELNET, // Send data to OpenTSDB using telnet API
+ BACKEND_TYPE_OPENTSDB_USING_HTTP, // Send data to OpenTSDB using HTTP API
+ BACKEND_TYPE_JSON, // Stores the data using JSON.
+ BACKEND_TYPE_PROMETEUS, // The user selected to use Prometheus backend
+ BACKEND_TYPE_KINESIS, // Send message to AWS Kinesis
+ BACKEND_TYPE_MONGODB // Send data to MongoDB collection
} BACKEND_TYPE;
@@ -56,6 +57,22 @@ extern calculated_number backend_calculate_value_from_stored_data(
extern size_t backend_name_copy(char *d, const char *s, size_t usable);
extern int discard_response(BUFFER *b, const char *backend);
+static inline char *strip_quotes(char *str) {
+ if(*str == '"' || *str == '\'') {
+ char *s;
+
+ str++;
+
+ s = str;
+ while(*s) s++;
+ if(s != str) s--;
+
+ if(*s == '"' || *s == '\'') *s = '\0';
+ }
+
+ return str;
+}
+
#endif // BACKENDS_INTERNALS
#include "backends/prometheus/backend_prometheus.h"
@@ -71,4 +88,8 @@ extern int discard_response(BUFFER *b, const char *backend);
#include "backends/prometheus/remote_write/remote_write.h"
#endif
+#if HAVE_MONGOC
+#include "backends/mongodb/mongodb.h"
+#endif
+
#endif /* NETDATA_BACKENDS_H */