Structures and functions supporting interaction with InfluxDB.
More...
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/uio.h>
#include <netdb.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <curl/curl.h>
Go to the source code of this file.
|
| int | _begin_line (char **buf) |
| int | _escaped_append (char **dest, size_t *len, size_t *used, const char *src, const char *escape_seq) |
| int | _format_line (char **buf, va_list ap) |
| int | _format_line2 (char **buf, va_list ap, size_t *, size_t) |
| int | format_line (char **buf, int *len, size_t used,...) |
| | Format a line for InfluxDB.
|
| int | post_curl (influx_v2_client_t *c,...) |
| | Post a line to InfluxDB via HTTP.
|
| int | post_http (influx_client_t *c,...) |
| | Post a line to InfluxDB via HTTP.
|
| int | post_http_send_line (influx_client_t *c, char *buf, int len) |
| | Post a line to InfluxDB via HTTP.
|
| int | send_udp (influx_client_t *c,...) |
| | Send a line to InfluxDB via UDP.
|
| int | send_udp_line (influx_client_t *c, char *line, int len) |
| | Send a line to InfluxDB via UDP.
|
Structures and functions supporting interaction with InfluxDB.
Usage:
int send_udp(influx_client_t *c,...)
Send a line to InfluxDB via UDP.
Definition influxdb.h:316
int post_http(influx_client_t *c,...)
Post a line to InfluxDB via HTTP.
Definition influxdb.h:274
#define INFLUX_F_BOL(k, v)
Definition influxdb.h:41
#define INFLUX_F_INT(k, v)
Definition influxdb.h:40
#define INFLUX_END
Definition influxdb.h:43
#define INFLUX_MEAS(m)
Definition influxdb.h:36
#define INFLUX_TS(ts)
Definition influxdb.h:42
#define INFLUX_F_FLT(k, v, p)
Definition influxdb.h:39
#define INFLUX_F_STR(k, v)
Definition influxdb.h:38
#define INFLUX_TAG(k, v)
Definition influxdb.h:37
NOTICE**: For best performance you should sort tags by key before sending them to the database. The sort should match the results from the Go bytes.Compare function.
◆ _APPEND
| #define _APPEND |
( |
| fmter... | ) |
|
Value: for (;;) { \
if ((written = snprintf(*buf + used, len - used, ##fmter)) < 0) \
goto FAIL; \
if (used + written >= len && !(*buf = (char*)realloc(*buf, len *= 2))) \
return -1; \
else { \
used += written; \
break; \
} \
}
◆ _GET_NEXT_CHAR
| #define _GET_NEXT_CHAR |
( |
| ) |
|
Value: (ch = (len >= (int)iv[0].iov_len && \
(iv[0].iov_len = recv(sock, iv[0].iov_base, iv[0].iov_len, len = 0)) == (size_t)(-1) \
? 0 \
: *((char*)iv[0].iov_base + len++)))
◆ _GET_NUMBER
Value:_LOOP_NEXT(
if (ch >=
'0' && ch <=
'9') n = n * 10 + (ch -
'0');
else break;)
#define _LOOP_NEXT(statement)
◆ _LOOP_NEXT
| #define _LOOP_NEXT |
( |
| statement | ) |
|
Value: for (;;) { \
ret_code = -8; \
goto END; \
} \
statement \
}
◆ _UNTIL
◆ IF_TYPE_ARG_END
| #define IF_TYPE_ARG_END 0 |
◆ IF_TYPE_FIELD_BOOLEAN
| #define IF_TYPE_FIELD_BOOLEAN 6 |
◆ IF_TYPE_FIELD_FLOAT
| #define IF_TYPE_FIELD_FLOAT 4 |
◆ IF_TYPE_FIELD_INTEGER
| #define IF_TYPE_FIELD_INTEGER 5 |
◆ IF_TYPE_FIELD_STRING
| #define IF_TYPE_FIELD_STRING 3 |
◆ IF_TYPE_MEAS
◆ IF_TYPE_TAG
◆ IF_TYPE_TIMESTAMP
| #define IF_TYPE_TIMESTAMP 7 |
◆ INFLUX_END
◆ INFLUX_F_BOL
| #define INFLUX_F_BOL |
( |
| k, |
|
|
| v ) |
Value:
#define IF_TYPE_FIELD_BOOLEAN
Definition influxdb.h:121
◆ INFLUX_F_FLT
| #define INFLUX_F_FLT |
( |
| k, |
|
|
| v, |
|
|
| p ) |
Value:
#define IF_TYPE_FIELD_FLOAT
Definition influxdb.h:119
◆ INFLUX_F_INT
| #define INFLUX_F_INT |
( |
| k, |
|
|
| v ) |
Value:
#define IF_TYPE_FIELD_INTEGER
Definition influxdb.h:120
◆ INFLUX_F_STR
| #define INFLUX_F_STR |
( |
| k, |
|
|
| v ) |
Value:
#define IF_TYPE_FIELD_STRING
Definition influxdb.h:118
◆ INFLUX_MEAS
Value:
#define IF_TYPE_MEAS
Definition influxdb.h:116
◆ INFLUX_TAG
| #define INFLUX_TAG |
( |
| k, |
|
|
| v ) |
Value:
#define IF_TYPE_TAG
Definition influxdb.h:117
◆ INFLUX_TS
Value:
#define IF_TYPE_TIMESTAMP
Definition influxdb.h:122
◆ _begin_line()
| int _begin_line |
( |
char ** | buf | ) |
|
◆ _escaped_append()
| int _escaped_append |
( |
char ** | dest, |
|
|
size_t * | len, |
|
|
size_t * | used, |
|
|
const char * | src, |
|
|
const char * | escape_seq ) |
◆ _format_line()
| int _format_line |
( |
char ** | buf, |
|
|
va_list | ap ) |
◆ _format_line2()
| int _format_line2 |
( |
char ** | buf, |
|
|
va_list | ap, |
|
|
size_t * | _len, |
|
|
size_t | used ) |