0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-05-04 01:10:03 +00:00
netdata_netdata/database/rrdfunctions.h
Costa Tsaousis d2daa19bf5
JSON internal API, IEEE754 base64/hex streaming, weights endpoint optimization ()
* first work on standardizing json formatting

* renamed old grouping to time_grouping and added group_by

* add dummy functions to enable compilation

* buffer json api work

* jsonwrap opening with buffer_json_X() functions

* cleanup

* storage for quotes

* optimize buffer printing for both numbers and strings

* removed ; from define

* contexts json generation using the new json functions

* fix buffer overflow at unit test

* weights endpoint using new json api

* fixes to weights endpoint

* check buffer overflow on all buffer functions

* do synchronous queries for weights

* buffer_flush() now resets json state too

* content type typedef

* print double values that are above the max 64-bit value

* str2ndd() can now parse values above UINT64_MAX

* faster number parsing by avoiding double calculations as much as possible

* faster number parsing

* faster hex parsing

* accurate printing and parsing of double values, even for very large numbers that cannot fit in 64bit integers

* full printing and parsing without using library functions - and related unit tests

* added IEEE754 streaming capability to enable streaming of double values in hex

* streaming and replication to transfer all values in hex

* use our own str2ndd for set2

* remove subnormal check from ieee

* base64 encoding for numbers, instead of hex

* when increasing double precision, also make sure the fractional number printed is aligned to the wanted precision

* str2ndd_encoded() parses all encoding formats, including integers

* prevent uninitialized use

* /api/v1/info using the new json API

* Fix error when compiling with --disable-ml

* Remove redundant 'buffer_unittest' declaration

* Fix formatting

* Fix formatting

* Fix formatting

* fix buffer unit test

* apps.plugin using the new JSON API

* make sure the metrics registry does not accept negative timestamps

* do not allow pages with negative timestamps to be loaded from db files; do not accept pages with negative timestamps in the cache

* Fix more formatting

---------

Co-authored-by: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com>
2023-02-15 21:16:29 +02:00

35 lines
1.6 KiB
C

#ifndef NETDATA_RRDFUNCTIONS_H
#define NETDATA_RRDFUNCTIONS_H 1
#include "rrd.h"
void rrdfunctions_init(RRDHOST *host);
void rrdfunctions_destroy(RRDHOST *host);
void rrd_collector_started(void);
void rrd_collector_finished(void);
typedef void (*function_data_ready_callback)(BUFFER *wb, int code, void *callback_data);
typedef int (*function_execute_at_collector)(BUFFER *wb, int timeout, const char *function, void *collector_data,
function_data_ready_callback callback, void *callback_data);
void rrd_collector_add_function(RRDHOST *host, RRDSET *st, const char *name, int timeout, const char *help,
bool sync, function_execute_at_collector function, void *collector_data);
int rrd_call_function_and_wait(RRDHOST *host, BUFFER *wb, int timeout, const char *name);
typedef void (*rrd_call_function_async_callback)(BUFFER *wb, int code, void *callback_data);
int rrd_call_function_async(RRDHOST *host, BUFFER *wb, int timeout, const char *name, rrd_call_function_async_callback, void *callback_data);
void rrd_functions_expose_rrdpush(RRDSET *st, BUFFER *wb);
void chart_functions2json(RRDSET *st, BUFFER *wb, int tabs, const char *kq, const char *sq);
void chart_functions_to_dict(DICTIONARY *rrdset_functions_view, DICTIONARY *dst);
void host_functions2json(RRDHOST *host, BUFFER *wb);
uint8_t functions_format_to_content_type(const char *format);
const char *functions_content_type_to_format(HTTP_CONTENT_TYPE content_type);
int rrd_call_function_error(BUFFER *wb, const char *msg, int code);
#endif // NETDATA_RRDFUNCTIONS_H