summaryrefslogtreecommitdiffstats
path: root/web/api/formatters/value/value.h
blob: 76b1869f36ba1c245f9f880d0b2844deb34a3337 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// SPDX-License-Identifier: GPL-3.0-or-later

#ifndef NETDATA_API_FORMATTER_VALUE_H
#define NETDATA_API_FORMATTER_VALUE_H

#include "../rrd2json.h"

typedef struct storage_value {
    NETDATA_DOUBLE value;
    NETDATA_DOUBLE anomaly_rate;
    time_t after;
    time_t before;
    size_t points_read;
    size_t storage_points_per_tier[RRD_STORAGE_TIERS];
    size_t result_points;
} QUERY_VALUE;

struct rrdmetric_acquired;
struct rrdinstance_acquired;
struct rrdcontext_acquired;

QUERY_VALUE rrdmetric2value(RRDHOST *host,
                            struct rrdcontext_acquired *rca, struct rrdinstance_acquired *ria, struct rrdmetric_acquired *rma,
                            time_t after, time_t before,
                            RRDR_OPTIONS options, RRDR_GROUPING group_method, const char *group_options,
                            size_t tier, time_t timeout, QUERY_SOURCE query_source
);

NETDATA_DOUBLE rrdr2value(RRDR *r, long i, RRDR_OPTIONS options, int *all_values_are_null, NETDATA_DOUBLE *anomaly_rate);

#endif //NETDATA_API_FORMATTER_VALUE_H