diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:19:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:20:17 +0000 |
commit | a64a253794ac64cb40befee54db53bde17dd0d49 (patch) | |
tree | c1024acc5f6e508814b944d99f112259bb28b1be /libnetdata/eval/eval.h | |
parent | New upstream version 1.10.0+dfsg (diff) | |
download | netdata-upstream/1.11.0+dfsg.tar.xz netdata-upstream/1.11.0+dfsg.zip |
New upstream version 1.11.0+dfsgupstream/1.11.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | libnetdata/eval/eval.h (renamed from src/eval.h) | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/eval.h b/libnetdata/eval/eval.h index 6a5562fd4..57dae9d0b 100644 --- a/src/eval.h +++ b/libnetdata/eval/eval.h @@ -1,8 +1,22 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + #ifndef NETDATA_EVAL_H -#define NETDATA_EVAL_H +#define NETDATA_EVAL_H 1 + +#include "../libnetdata.h" #define EVAL_MAX_VARIABLE_NAME_LENGTH 300 +typedef enum rrdcalc_status { + RRDCALC_STATUS_REMOVED = -2, + RRDCALC_STATUS_UNDEFINED = -1, + RRDCALC_STATUS_UNINITIALIZED = 0, + RRDCALC_STATUS_CLEAR = 1, + RRDCALC_STATUS_RAISED = 2, + RRDCALC_STATUS_WARNING = 3, + RRDCALC_STATUS_CRITICAL = 4 +} RRDCALC_STATUS; + typedef struct eval_variable { char *name; uint32_t hash; @@ -59,7 +73,7 @@ typedef struct eval_expression { extern EVAL_EXPRESSION *expression_parse(const char *string, const char **failed_at, int *error); // free all resources allocated for an expression -extern void expression_free(EVAL_EXPRESSION *op); +extern void expression_free(EVAL_EXPRESSION *expression); // convert an error code to a message extern const char *expression_strerror(int error); @@ -69,4 +83,6 @@ extern const char *expression_strerror(int error); // 2 = FAILED, the error message is in: buffer_tostring(expression->error_msg) extern int expression_evaluate(EVAL_EXPRESSION *expression); +extern int health_variable_lookup(const char *variable, uint32_t hash, struct rrdcalc *rc, calculated_number *result); + #endif //NETDATA_EVAL_H |