0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-05-07 02:30:12 +00:00
netdata_netdata/web/api/queries/query.h
Costa Tsaousis cd50bf4236
/api/v2 part 4 ()
* expose the order of group by

* key renames in json wrapper v2

* added group by context and group by units

* added view_average_values

* fix for view_average_values when percentage is specified

* option group-by-labels is enabling the exposure of all the labels that are used for each of the final grouped dimensions

* when executing group by queries, allocate one dimension data at a time - not all of them

* respect hidden dimensions

* cancel running data query on socket error

* use poll to detect socket errors

* use POLLRDHUP to detect half closed connections

* make sure POLLRDHUP is available

* do not destroy aral-by-size arals

* completed documentation of /api/v2/data.

* moved min, max back to view; updated swagger yaml and json

* default format for /api/v2/data is json2
2023-03-13 23:39:06 +02:00

88 lines
2.6 KiB
C

// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef NETDATA_API_DATA_QUERY_H
#define NETDATA_API_DATA_QUERY_H
#ifdef __cplusplus
extern "C" {
#endif
typedef enum rrdr_time_grouping {
RRDR_GROUPING_UNDEFINED = 0,
RRDR_GROUPING_AVERAGE,
RRDR_GROUPING_MIN,
RRDR_GROUPING_MAX,
RRDR_GROUPING_SUM,
RRDR_GROUPING_INCREMENTAL_SUM,
RRDR_GROUPING_TRIMMED_MEAN1,
RRDR_GROUPING_TRIMMED_MEAN2,
RRDR_GROUPING_TRIMMED_MEAN3,
RRDR_GROUPING_TRIMMED_MEAN5,
RRDR_GROUPING_TRIMMED_MEAN10,
RRDR_GROUPING_TRIMMED_MEAN15,
RRDR_GROUPING_TRIMMED_MEAN20,
RRDR_GROUPING_TRIMMED_MEAN25,
RRDR_GROUPING_MEDIAN,
RRDR_GROUPING_TRIMMED_MEDIAN1,
RRDR_GROUPING_TRIMMED_MEDIAN2,
RRDR_GROUPING_TRIMMED_MEDIAN3,
RRDR_GROUPING_TRIMMED_MEDIAN5,
RRDR_GROUPING_TRIMMED_MEDIAN10,
RRDR_GROUPING_TRIMMED_MEDIAN15,
RRDR_GROUPING_TRIMMED_MEDIAN20,
RRDR_GROUPING_TRIMMED_MEDIAN25,
RRDR_GROUPING_PERCENTILE25,
RRDR_GROUPING_PERCENTILE50,
RRDR_GROUPING_PERCENTILE75,
RRDR_GROUPING_PERCENTILE80,
RRDR_GROUPING_PERCENTILE90,
RRDR_GROUPING_PERCENTILE95,
RRDR_GROUPING_PERCENTILE97,
RRDR_GROUPING_PERCENTILE98,
RRDR_GROUPING_PERCENTILE99,
RRDR_GROUPING_STDDEV,
RRDR_GROUPING_CV,
RRDR_GROUPING_SES,
RRDR_GROUPING_DES,
RRDR_GROUPING_COUNTIF,
} RRDR_TIME_GROUPING;
const char *time_grouping_method2string(RRDR_TIME_GROUPING group);
void time_grouping_init(void);
RRDR_TIME_GROUPING time_grouping_parse(const char *name, RRDR_TIME_GROUPING def);
const char *time_grouping_tostring(RRDR_TIME_GROUPING group);
typedef enum rrdr_group_by {
RRDR_GROUP_BY_NONE = 0,
RRDR_GROUP_BY_SELECTED = (1 << 0),
RRDR_GROUP_BY_DIMENSION = (1 << 1),
RRDR_GROUP_BY_NODE = (1 << 2),
RRDR_GROUP_BY_INSTANCE = (1 << 3),
RRDR_GROUP_BY_LABEL = (1 << 4),
RRDR_GROUP_BY_CONTEXT = (1 << 5),
RRDR_GROUP_BY_UNITS = (1 << 6),
} RRDR_GROUP_BY;
struct web_buffer;
RRDR_GROUP_BY group_by_parse(char *s);
void buffer_json_group_by_to_array(struct web_buffer *wb, RRDR_GROUP_BY group_by);
typedef enum rrdr_group_by_function {
RRDR_GROUP_BY_FUNCTION_AVERAGE,
RRDR_GROUP_BY_FUNCTION_MIN,
RRDR_GROUP_BY_FUNCTION_MAX,
RRDR_GROUP_BY_FUNCTION_SUM,
} RRDR_GROUP_BY_FUNCTION;
RRDR_GROUP_BY_FUNCTION group_by_aggregate_function_parse(const char *s);
const char *group_by_aggregate_function_to_string(RRDR_GROUP_BY_FUNCTION group_by_function);
struct query_data_statistics;
void query_target_merge_data_statistics(struct query_data_statistics *d, struct query_data_statistics *s);
#ifdef __cplusplus
}
#endif
#endif //NETDATA_API_DATA_QUERY_H