summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2022-06-29 19:24:08 +0300
committerGitHub <noreply@github.com>2022-06-29 19:24:08 +0300
commit2fc0aaca9a27520c874756b16d95794457ed6ac9 (patch)
tree3a46c4b1abbe0ede6c88a506aa01d229ad146f54 /daemon
parentf5a49bd9ab48b0e5569165cb7f6dcb5362048bd6 (diff)
Query engine with natural and virtual points (#13248)
* new query engine * use Index * Revert change that changed in-memory page indexing to start time - update_every + 1 * use internal_error() to cleanup the code * interpolates values when generating points Co-authored-by: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com>
Diffstat (limited to 'daemon')
-rw-r--r--daemon/unit_test.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/daemon/unit_test.c b/daemon/unit_test.c
index ccaf44f9fd..0d445f9b4c 100644
--- a/daemon/unit_test.c
+++ b/daemon/unit_test.c
@@ -1824,7 +1824,10 @@ static int test_dbengine_check_rrdr(RRDSET *st[CHARTS], RRDDIM *rd[CHARTS][DIMS]
long points = (time_end - time_start) / update_every;
for (i = 0 ; i < CHARTS ; ++i) {
ONEWAYALLOC *owa = onewayalloc_create(0);
- RRDR *r = rrd2rrdr(owa, st[i], points, time_start, time_end, RRDR_GROUPING_AVERAGE, 0, 0, NULL, NULL, NULL, 0);
+ RRDR *r = rrd2rrdr(owa, st[i], points, time_start, time_end,
+ RRDR_GROUPING_AVERAGE, 0, RRDR_OPTION_NATURAL_POINTS,
+ NULL, NULL, NULL, 0);
+
if (!r) {
fprintf(stderr, " DB-engine unittest %s: empty RRDR on region %d ### E R R O R ###\n", st[i]->name, current_region);
return ++errors;
@@ -1846,14 +1849,14 @@ static int test_dbengine_check_rrdr(RRDSET *st[CHARTS], RRDDIM *rd[CHARTS][DIMS]
same = (roundndd(value) == roundndd(expected)) ? 1 : 0;
if(!same) {
- if(value_errors < 10)
+ if(value_errors < 20)
fprintf(stderr, " DB-engine unittest %s/%s: at %lu secs, expecting value " NETDATA_DOUBLE_FORMAT
", RRDR found " NETDATA_DOUBLE_FORMAT ", ### E R R O R ###\n",
st[i]->name, rd[i][j]->name, (unsigned long)time_now, expected, value);
value_errors++;
}
if(time_retrieved != time_now) {
- if(!time_errors)
+ if(time_errors < 20)
fprintf(stderr, " DB-engine unittest %s/%s: at %lu secs, found RRDR timestamp %lu ### E R R O R ###\n",
st[i]->name, rd[i][j]->name, (unsigned long)time_now, (unsigned long)time_retrieved);
time_errors++;
@@ -1955,7 +1958,9 @@ int test_dbengine(void)
long point_offset = (time_start[current_region] - time_start[0]) / update_every;
for (i = 0 ; i < CHARTS ; ++i) {
ONEWAYALLOC *owa = onewayalloc_create(0);
- RRDR *r = rrd2rrdr(owa, st[i], points, time_start[0] + update_every, time_end[REGIONS - 1], RRDR_GROUPING_AVERAGE, 0, 0, NULL, NULL, NULL, 0);
+ RRDR *r = rrd2rrdr(owa, st[i], points, time_start[0] + update_every,
+ time_end[REGIONS - 1], RRDR_GROUPING_AVERAGE, 0,
+ RRDR_OPTION_NATURAL_POINTS, NULL, NULL, NULL, 0);
if (!r) {
fprintf(stderr, " DB-engine unittest %s: empty RRDR ### E R R O R ###\n", st[i]->name);
++errors;