All Projects → offa → influxdb-cxx

offa / influxdb-cxx

Licence: MIT license
Fork of the unmaintained https://github.com/awegrzyn/influxdb-cxx project.

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects
python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to influxdb-cxx

influx-query-builder
The super lightweight InfluxDB query builder implemented in Go
Stars: ✭ 16 (-65.96%)
Mutual labels:  influxdb, influxdb-client
telemetry collector
build telemetry software stack for Cisco nx-os, support both telemetry dial-out and gNMI dial-in
Stars: ✭ 39 (-17.02%)
Mutual labels:  influxdb
trickster
Open Source HTTP Reverse Proxy Cache and Time Series Dashboard Accelerator
Stars: ✭ 1,753 (+3629.79%)
Mutual labels:  influxdb
influxdb-c
💙 C write client for InfluxDB.
Stars: ✭ 28 (-40.43%)
Mutual labels:  influxdb
effluence
Zabbix loadable module for real-time export of history to InfluxDB
Stars: ✭ 26 (-44.68%)
Mutual labels:  influxdb
envsensor-observer-py
Python Bluetooth low energy observer example for OMRON Environment Sensor (2JCIE-BL01)
Stars: ✭ 31 (-34.04%)
Mutual labels:  influxdb
csv2influx
A CLI tool for importing CSV files into Influxdb
Stars: ✭ 16 (-65.96%)
Mutual labels:  influxdb
inspector-metrics
Typescript metrics / monitoring library
Stars: ✭ 19 (-59.57%)
Mutual labels:  influxdb
grafana-dashboards
List of Grafana Dashboards 📺
Stars: ✭ 120 (+155.32%)
Mutual labels:  influxdb
geostat
GeoStat, Python script for parsing Nginx and Apache logs files and getting GEO data from incoming IP's.
Stars: ✭ 50 (+6.38%)
Mutual labels:  influxdb
air-quality
Live dashboard for air quality in my home.
Stars: ✭ 70 (+48.94%)
Mutual labels:  influxdb
formula1-telemetry-kafka
No description or website provided.
Stars: ✭ 99 (+110.64%)
Mutual labels:  influxdb
docker-telegraf-influxdb-grafana
Docker Image with Telegraf, InfluxDB and Grafana
Stars: ✭ 17 (-63.83%)
Mutual labels:  influxdb
solar-logger
A datalogger for a solar inverter. Stores data in influxdb and displays it in grafana. Has load diverting capability, to use the inverter's excess power
Stars: ✭ 53 (+12.77%)
Mutual labels:  influxdb
uber-cli
Beeps when surge is gone
Stars: ✭ 29 (-38.3%)
Mutual labels:  influxdb
influx-crypto-watcher
Server that let you monitor many cryptocurrencies and store the OHLC data in InfluxDB (visualisation with grafana)
Stars: ✭ 49 (+4.26%)
Mutual labels:  influxdb
ml-ops
Get your MLOps (Level 1) platform started and going fast.
Stars: ✭ 81 (+72.34%)
Mutual labels:  influxdb
continuous-analytics-examples
A collection of examples of continuous analytics.
Stars: ✭ 17 (-63.83%)
Mutual labels:  influxdb
dropwizard-influxdb-reporter
Dropwizard Integrations for InfluxDB.
Stars: ✭ 16 (-65.96%)
Mutual labels:  influxdb
influxdb-cxx
C++ client library for InfluxDB 1.x/2.x
Stars: ✭ 69 (+46.81%)
Mutual labels:  influxdb

influxdb-cxx

CI GitHub release License C++

InfluxDB C++ client library

  • Batch write
  • Data exploration
  • Supported transports
    • HTTP/HTTPS with Basic Auth
    • UDP
    • Unix datagram socket

Installation

Build requirements

  • CMake 3.12+
  • C++17 compiler

Dependencies

  • CURL (required)
  • boost 1.57+ (optional – see Transports)

Generic

mkdir build && cd build
cmake ..
sudo make install

Quick start

Include in CMake project

The InfluxDB library is exported as target InfluxData::InfluxDB.

project(example)

find_package(InfluxDB)

add_executable(example-influx main.cpp)
target_link_libraries(example-influx PRIVATE InfluxData::InfluxDB)

This target is also provided when the project is included as a subdirectory.

project(example)
add_subdirectory(influxdb-cxx)
add_executable(example-influx main.cpp)
target_link_libraries(example-influx PRIVATE InfluxData::InfluxDB)

Basic write

// Provide complete URI
auto influxdb = influxdb::InfluxDBFactory::Get("http://localhost:8086?db=test");
influxdb->write(influxdb::Point{"test"}
  .addField("value", 10)
  .addTag("host", "localhost")
);

Batch write

auto influxdb = influxdb::InfluxDBFactory::Get("http://localhost:8086?db=test");
// Write batches of 100 points
influxdb->batchOf(100);

for (;;) {
  influxdb->write(influxdb::Point{"test"}.addField("value", 10));
}
Note:

When batch write is enabled, call flushBatch() to flush pending batches. This is of particular importance to ensure all points are written prior to destruction.

auto influxdb = influxdb::InfluxDBFactory::Get("http://localhost:8086?db=test");
influxdb->batchOf(3);
influxdb->write(influxdb::Point{"test"}.addField("value", 1));
influxdb->write(influxdb::Point{"test"}.addField("value", 2));

// Flush batches, both points are written
influxdb->flushBatch();

Query

// Available over HTTP only
auto influxdb = influxdb::InfluxDBFactory::Get("http://localhost:8086?db=test");
/// Pass an IFQL to get list of points
std::vector<influxdb::Point> points = idb->query("SELECT * FROM test");

Transports

An underlying transport is fully configurable by passing an URI:

[protocol]://[username:password@]host:port[?db=database]

List of supported transport is following:
Name Dependency URI protocol Sample URI
HTTP cURLi) http/https http://localhost:8086?db=<db>
UDP boost udp udp://localhost:8094
Unix socket boost unix unix:///tmp/telegraf.sock

i) boost is needed to support queries.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].