summaryrefslogtreecommitdiffstats
path: root/src/plugins/tsdb.h
blob: d7d6c2f571c6e37fac0836ff6d62c1de21973958 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 * Copyright (C) 2015, 2016, 2017, 2018 "IoT.bzh"
 * Author "Romain Forlot" <romain.forlot@iot.bzh>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *	 http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#define AFB_BINDING_VERSION 2
#include <afb/afb-binding.h>

#include <json-c/json.h>
#include "curl-wrap.h"

#define DEFAULT_DB "agl-garner"
#define DEFAULT_DBHOST "localhost"
#define DEFAULT_DBPORT "8086"
#define URL_MAXIMUM_LENGTH 2047

enum db_available {
	INFLUX = 1,
	GRAPHITE = 2,
	OPENTSDB = 4
};

struct reader_args {
	const char *host;
	const char *port;
};

CURL *influxdb_write(const char* host, const char *port, json_object *metric);
void influxdb_write_curl_cb(void *closure, int status, CURL *curl, const char *result, size_t size);

int influxdb_reader(void *args);

int db_ping();
pan class="s">"CogentEmbedded/meta-rcar" path="meta-rcar" remote="github" revision="de24bb576c135c6617827d977382611d894ffb70" upstream="v3.9.0"/> <!-- Updater layers. --> <project name="advancedtelematic/meta-updater" path="meta-updater" remote="github" revision="ff555e8690eb47177ade42dc6912ae17a759cc45" upstream="rocko"/> <project name="advancedtelematic/meta-updater-qemux86-64" path="meta-updater-qemux86-64" remote="github" revision="697632ddd98ed7ae3dbd0bd84abb04079767bc56" upstream="rocko"/> <!-- Yocto/OpenEmbedded things. --> <project name="poky" path="poky" remote="yocto" revision="05711ba18587aaaf4a9c465a1dd4537f27ceda93" upstream="rocko" /> <project name="meta-gplv2" path="meta-gplv2" remote="yocto" revision="f875c60ecd6f30793b80a431a2423c4b98e51548" upstream="rocko" /> <project name="meta-openembedded" path="meta-openembedded" remote="openembedded" revision="eae996301d9c097bcbeb8046f08041dc82bb62f8" upstream="rocko" /> <project name="meta-virtualization" path="meta-virtualization" remote="yocto" revision="bd77388f31929f38e7d4cc9c711f0f83f563007e" upstream="rocko"/> <!-- Qt things --> <!-- Qt 5.8 --> <project name="meta-qt5/meta-qt5" path="meta-qt5" remote="github" revision="682ad61c071a9710e9f9d8a32ab1b5f3c14953d1" upstream="rocko"/> <!-- MinnowBoard MAX specific things --> <project name="meta-intel" path="meta-intel" remote="yocto" revision="718bb384942675437c081f6795da7f421da1fee6" upstream="rocko"/> <!-- i.MX6 / e.g. wandboard specific things --> <!-- <project name="Freescale/meta-freescale" path="meta-freescale" remote="github" revision="06178400afbd641a6709473fd21d893dcd3cfbfa" upstream="pyro"/> <project name="Freescale/meta-freescale-3rdparty" path="meta-freescale-3rdparty" remote="github" revision="35badbde05d4f10d4faeefc30bc126b5bd228e2e" upstream="pyro"/> <project name="Freescale/meta-freescale-distro" path="meta-freescale-distro" remote="github" revision="cd5c7a2539f40004f74126e9fdf08254fd9a6390" upstream="pyro"/> --> <!-- consolidate on meta-freescale from git.yoctoproject.org --> <project name="meta-freescale" path="meta-freescale" remote="yocto" revision="a4158e3425a79720ddc4c02e76251d567bdceb51" upstream="rocko"/> <!-- Boundary devices bsp layer --> <project name="boundarydevices/meta-boundary" path="meta-boundary" remote="github" revision="f96f41b2e5beda2b51acb702d082568898b36a68" upstream="rocko"/> <!-- ti vayu / jacinto 6 / DRA7 --> <project name="meta-ti" path="meta-ti" remote="yocto" revision="ed83a43c6a76875ee5f0388b3b60a28f2a373a10" upstream="rocko"/> <!-- iotivity --> <project name="meta-oic" path="meta-oic" remote="yocto" revision="6e831e4bcdfa6ab8c26eb4fca4bdc98faf028818" upstream="1.2.1"/> <!-- rpi 2, 3 and 3 B+ --> <project name="meta-raspberrypi" path="meta-raspberrypi" remote="yocto" revision="8e4c537d84fdde8e3b4642d0dda2c0f4af76d52f" upstream="rocko"/> <!-- DragonBoard 410c specific things --> <project name="meta-qcom" path="meta-qcom" remote="yocto" revision="68d67447ec83de4784203afa016c49538165532d" upstream="rocko"/> <!-- Altera SOCFPGA platform --> <!-- pinned to version from master until branch for morty exists --> <!-- https://github.com/kraj/meta-altera --> <project name="kraj/meta-altera" path="meta-altera" remote="github" revision="2fdcab3bf66f771bea9a3877bddb825195d56e0f" upstream="rocko"/> <!-- Image Security Analysis FrameWork (isafw) --> <!-- try master or disable --> <project name="01org/meta-security-isafw" path="meta-security-isafw" remote="github" revision="489abdc65cefb566d696c8b218aa0b9b99a350ae" upstream="master"/> <!-- Security layer --> <project name="meta-security" path="meta-security" remote="yocto" revision="8f6969a775fa6afbf553e72ba83e71197780b2d8" upstream="master"/> <!-- SmartDeviceLink layer --> <project name="phongt/meta-sdl" path="meta-sdl" remote="github" revision="60c9fe8a4a9c6ca95f222685f8d6248f16236f2a" upstream="release/4.4.0"/> </manifest>