orca-zhang / Influxdb Cpp
Licence: mit
💜 C++ client for InfluxDB.
Stars: ✭ 100
Programming Languages
cpp
1120 projects
Projects that are alternatives of or similar to Influxdb Cpp
Vbasync
Cross-platform tool to synchronize macros from an Office VBA-enabled file with a version-controlled folder
Stars: ✭ 98 (-2%)
Mutual labels: cross-platform
App
free software application for social network analysis and visualization
Stars: ✭ 94 (-6%)
Mutual labels: cross-platform
Mln
高性能、小巧、易上手的移动跨平台开发框架. A framework for building Mobile cross-platform apps with Lua
Stars: ✭ 1,343 (+1243%)
Mutual labels: cross-platform
Cron4s
Cross-platform CRON expression parsing for Scala
Stars: ✭ 99 (-1%)
Mutual labels: cross-platform
Packetsender
Network utility for sending / receiving TCP, UDP, SSL
Stars: ✭ 1,349 (+1249%)
Mutual labels: cross-platform
Shapes
📐 Net standard geometry/shape manipulation library, can be used to merge / split shapes
Stars: ✭ 95 (-5%)
Mutual labels: cross-platform
Flutter todo
Yet another Todo app, now using Flutter (with ScopedModel)
Stars: ✭ 94 (-6%)
Mutual labels: cross-platform
Libpnet
Cross-platform, low level networking using the Rust programming language.
Stars: ✭ 1,322 (+1222%)
Mutual labels: cross-platform
Essentials
Essential cross platform APIs for your mobile apps.
Stars: ✭ 1,344 (+1244%)
Mutual labels: cross-platform
Reactivemvvm
Cross-platform ReactiveUI sample app built for a talk at MSK .NET conf.
Stars: ✭ 94 (-6%)
Mutual labels: cross-platform
Openpanzer
Javascript/HTML5 rewrite of Panzer General 2 game
Stars: ✭ 98 (-2%)
Mutual labels: cross-platform
Dotabuddy
DotaBuddy is a cross-platform, open-source application with helpful features for when you're playing a match of Dota 2.
Stars: ✭ 93 (-7%)
Mutual labels: cross-platform
Cherrypy
CherryPy is a pythonic, object-oriented HTTP framework. https://docs.cherrypy.org/
Stars: ✭ 1,363 (+1263%)
Mutual labels: cross-platform
Wait4disney
Shanghai Disney Waiting Queue Statistics 上海迪士尼排队情况
Stars: ✭ 99 (-1%)
Mutual labels: influxdb
influxdb-cpp
A header-only C++ query & write client for InfluxDB.
- Support versions:
- InfluxDB v0.9 ~ 1.7
- Check yourself while using other versions.
Why use influxdb-cpp?
-
Exactly-small:
- Less than 300 lines and only 10KB+.
-
Easy-to-use:
- It's designed to be used without extra studies.
-
Easy-to-assemble:
- Only a tiny header file needs to be included.
-
No-dependencies:
- Unless STL and std C libraries.
Examples
Before using
-
The very simple thing you should do before using is only:
#include "influxdb.hpp"
Writing example
-
You should refer to the write syntax while writing series(metrics).
measurement[,tag-key=tag-value...] field-key=field-value[,field2-key=field2-value...] [unix-nano-timestamp]
-
You can rapidly start writing serires by according to the following example.
influxdb_cpp::server_info si("127.0.0.1", 8086, "db", "usr", "pwd"); influxdb_cpp::builder() .meas("foo") .tag("k", "v") .tag("x", "y") .field("x", 10) .field("y", 10.3, 2) .field("z", 10.3456) .field("b", !!10) .timestamp(1512722735522840439) .post_http(si);
-
Remarks:
- 3rd parameter
precision
offield()
is optional for floating point value, and default precision is2
. -
usr
andpwd
is optional for authorization.
- 3rd parameter
-
Remarks:
-
The series sent is:
foo,k=v,x=y x=10i,y=10.30,z=10.35,b=t 1512722735522840439
-
You could change
post_http
tosend_udp
for udp request. And onlyhost
andport
is required for udp.influxdb_cpp::builder() .meas("foo") .field("x", 10) .send_udp("127.0.0.1", 8091);
-
Bulk/batch/multiple insert also supports:
influxdb_cpp::builder() .meas("foo") // series 1 .field("x", 10) .meas("bar") // series 2 .field("y", 10.3) .send_udp("127.0.0.1", 8091);
-
The series sent are:
foo x=10i bar y=10.30
Query example
-
And you can query series by according to the following example.
influxdb_cpp::server_info si("127.0.0.1", 8086, "db", "usr", "pwd"); string resp; influxdb_cpp::query(resp, "select * from t", si);
Remarks for Windows
- You should init socket environment by yourself under Windows.
TODO
- Add more test cases.
- Supports DSN initializatin for server_info.
- Do not need to connect every time.
Misc
- Please feel free to use influxdb-cpp.
- Looking forward to your suggestions.
- If your project is using influxdb-cpp, you can show your project or company here by creating a issue or let me know.
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].