0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-05-06 10:10:11 +00:00
netdata_netdata/web/api/web_api_v1.h
Costa Tsaousis 986a1abf68
73x times faster metrics correlations at the agent ()
* faster correlations

* 4x times faster correlations

* a little bit more help

* 10x times faster metrics correlations

* 6 digits precision; better comments

* enabled metrics correlations by default

* abstracted DIFFS_NUMBER to allow easily changing it

* reworked the entire logic to have more accuracy and support a baseline that is power of two multiple of highlight

* properly calculate shifts

* even more improved version

* added support for timeout; fixed another memory leak; skipped hidden dimensions

* default timeout 1min

* reduce memory even further

* use dictionary for the list of charts and optimize locks

* return 403 forbidden, when mc is not enabled

* added query options

* dont process zero dimensions

* added volume method as an option to metric correlations ; now metric correlations can support multiple implementations

* make sure we will never crash

* spread results evenly for both kstwo and volume

* fixed bug in query engine that was missing misaligned queries when a single point was requested from the db; improved comments; improved query flags

* updated swagger and added sane defaults; query options are now supported, including anomaly-bit

* added "raw" option to allow cross node correlations; added "group" option to allow different time aggregations; allowed calling metric correlations without any parameters; allowed calling metric correlations with relative timestamps; added timeout to volume method; properly handled timeout on ks2 method; json output now sends all parameters back - same for json_wrap; modified query engine to use present time for relative timestamps; modified "allow_past" to mean both past backwards and forwards

* emulate the old behaviour about zero points

* 100% accuracy against python ks_2samp(); now the default is volume and the default points are 500

* added config option to change default metric correlations method

* removed work-arounds now that rrdlabels are merged
2022-06-13 21:31:52 +03:00

39 lines
2.1 KiB
C

// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef NETDATA_WEB_API_V1_H
#define NETDATA_WEB_API_V1_H 1
#include "daemon/common.h"
#include "web/api/badges/web_buffer_svg.h"
#include "web/api/formatters/rrd2json.h"
#include "web/api/health/health_cmdapi.h"
#define MAX_CHART_LABELS_FILTER (32)
extern RRDR_OPTIONS web_client_api_request_v1_data_options(char *o);
extern void web_client_api_request_v1_data_options_to_string(BUFFER *wb, RRDR_OPTIONS options);
extern uint32_t web_client_api_request_v1_data_format(char *name);
extern uint32_t web_client_api_request_v1_data_google_format(char *name);
extern int web_client_api_request_v1_alarms(RRDHOST *host, struct web_client *w, char *url);
extern int web_client_api_request_v1_alarms_values(RRDHOST *host, struct web_client *w, char *url);
extern int web_client_api_request_v1_alarm_log(RRDHOST *host, struct web_client *w, char *url);
extern int web_client_api_request_single_chart(RRDHOST *host, struct web_client *w, char *url, void callback(RRDSET *st, BUFFER *buf));
extern int web_client_api_request_v1_alarm_variables(RRDHOST *host, struct web_client *w, char *url);
extern int web_client_api_request_v1_alarm_count(RRDHOST *host, struct web_client *w, char *url);
extern int web_client_api_request_v1_charts(RRDHOST *host, struct web_client *w, char *url);
extern int web_client_api_request_v1_archivedcharts(RRDHOST *host, struct web_client *w, char *url);
extern int web_client_api_request_v1_chart(RRDHOST *host, struct web_client *w, char *url);
extern int web_client_api_request_v1_data(RRDHOST *host, struct web_client *w, char *url);
extern int web_client_api_request_v1_registry(RRDHOST *host, struct web_client *w, char *url);
extern int web_client_api_request_v1_info(RRDHOST *host, struct web_client *w, char *url);
extern int web_client_api_request_v1(RRDHOST *host, struct web_client *w, char *url);
extern int web_client_api_request_v1_info_fill_buffer(RRDHOST *host, BUFFER *wb);
extern void host_labels2json(RRDHOST *host, BUFFER *wb, size_t indentation);
extern void web_client_api_v1_init(void);
extern void web_client_api_v1_management_init(void);
extern char *api_secret;
#endif //NETDATA_WEB_API_V1_H