InfluxDB Component
Grafana
Grafana is a data visualization tool used to display and represent the data.
Communication architecture
InfluxDB configuration in Shunya
Config | Descriptions |
---|---|
Influx DB URL | url to the Influx DB instance. |
Database Name | Name of the database in which the data gets stored. |
The configurations need to be set manually by the user before using the API's
For example:
A sample JSON snippet should contain
"influxdb" : {
"influxdb url": "",
"db name": "",
}
Commonly configured parameters
For example:
A typical Influxdb configuration without security will look like this
"test-db" : {
"influxdb url": "http://148.251.91.253:8086/",
"db name": "test-db",
}
API's
API | Description | Details |
---|---|---|
newInfluxdb() | Create a new Influx DB Instance. | Read More |
writeDbInflux() | Send Data to Influx DB. | Read More |
newInfluxdb()
Description : Creates a new Influxdb Instance
Parameters
name (char *)
- Name of the JSON object.
Return-type : influxdbObj
Returns : influxdbObj Instance for Influxdb
Usage :
For example: Lets say your JSON file looks like
"test-db" : {
"influxdb url": "http://148.251.91.253:8086/",
"db name": "test-db",
}
So the usage of the API's will be
influxdbObj testdb = newInfluxdb("test-db");
writeDbInflux()
Description : Send Data to Influx DB.
Parameters
obj
(influxdbObj) - the InfulxDB Instancedata
(char) - the data to be sent to Influxdb in Influx db line format...
Return-type : int8_t
Usage :
influxdbObj testdb = newInfluxdb("test-db");
writeDbInflux (testdb, "measurement,tag1,tag2 value1=%d,value2=%d %ld", temp, pressure, unix_timestamp);