diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-04-14 01:57:17 +0200 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-07-10 23:41:14 +0200 |
commit | 5d50f0426699a06b5720e10f1feaef35c8b59f57 (patch) | |
tree | 34641293f0eef907c89ffa1cb6d6b80b863106fc /src/harvester.c | |
parent | be6447ca2038c84d2e946e27b897815e95c48e34 (diff) |
Improve writer/reader processing
- Handle indefinite number and kind of tags and fields for a metric
- Include only once header files
- Cleaning and ordering code
Change-Id: I14a4f0e6e1626971bff73ce7d9ac067bda69cfc4
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/harvester.c')
-rw-r--r-- | src/harvester.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/harvester.c b/src/harvester.c index b137e9c..30ba486 100644 --- a/src/harvester.c +++ b/src/harvester.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015, 2016, 2017, 2018 "IoT.bzh" + * Copyright (C) 2018 "IoT.bzh" * Author "Romain Forlot" <romain.forlot@iot.bzh> * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -23,12 +23,10 @@ #include "curl-wrap.h" #include "wrap-json.h" -#define ERROR -1 - CURL* (*tsdb_write)(const char* host, const char *port, json_object *metric); void (*write_curl_cb)(void *closure, int status, CURL *curl, const char *result, size_t size); -struct reader_args r_args = {NULL, NULL}; +struct reader_args r_args = {NULL, NULL, 1000000}; int do_write(struct afb_req req, const char* host, const char *port, json_object *metric) { @@ -40,7 +38,7 @@ int do_write(struct afb_req req, const char* host, const char *port, json_object return 0; } -void record(struct afb_req req) +void afv_write(struct afb_req req) { const char *port = NULL; const char *host = NULL; @@ -64,7 +62,7 @@ Malformed !"); } } -void auth(struct afb_req request) +void afv_auth(struct afb_req request) { afb_req_session_set_LOA(request, 1); afb_req_success(request, NULL, NULL); @@ -94,6 +92,6 @@ int init() return ERROR; break; } - + /* TODO:*/ return 0; } |