diff options
author | thiagoftsm <thiagoftsm@gmail.com> | 2019-10-21 11:59:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-21 11:59:15 +0000 |
commit | 23da557d13913e7dae3fdf4461309876b4b80581 (patch) | |
tree | a8e5f5ae09b44760558346984bef702e69f29ccb /libnetdata/eval | |
parent | 0b7ba99b5e344620ea3f1e633ba574590b9eda82 (diff) |
Netdata not returning correct value for unknow variables (#6984)
* health_nan: fix result
The expression evaluate was keeping the value zero when there was a wrong variable,
but according our documentation the correct result would be NAN, this commit fixes this
* health_nan: mapping
* health_nan: Set variable
After few tests, I am setting the NAN value to the variable in the correct place
Diffstat (limited to 'libnetdata/eval')
-rw-r--r-- | libnetdata/eval/eval.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libnetdata/eval/eval.c b/libnetdata/eval/eval.c index 0316edac0c..f8af801f51 100644 --- a/libnetdata/eval/eval.c +++ b/libnetdata/eval/eval.c @@ -176,7 +176,7 @@ static inline calculated_number eval_variable(EVAL_EXPRESSION *exp, EVAL_VARIABL *error = EVAL_ERROR_UNKNOWN_VARIABLE; buffer_sprintf(exp->error_msg, "[ undefined variable '%s' ] ", v->name); - return 0; + return NAN; } static inline calculated_number eval_value(EVAL_EXPRESSION *exp, EVAL_VALUE *v, int *error) { |