summaryrefslogtreecommitdiffstats
path: root/database
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2023-10-04 20:54:16 +0300
committerGitHub <noreply@github.com>2023-10-04 20:54:16 +0300
commit9fd9823e077869987e7d2b665fd46ac3e5a015ec (patch)
tree476937a7dd0a734e9f04678e6fd5cc69e88ba7c7 /database
parent0904758540fe93fd92829960497e66d4a0a82a4d (diff)
journal: fix the 1 second latency in play mode (#16123)
provide a relative_to_absolute function that does not touch the current realtime time
Diffstat (limited to 'database')
-rw-r--r--database/contexts/api_v1.c4
-rw-r--r--database/contexts/api_v2.c4
-rw-r--r--database/contexts/query_target.c5
3 files changed, 8 insertions, 5 deletions
diff --git a/database/contexts/api_v1.c b/database/contexts/api_v1.c
index d8446d8490..f144e6f7b8 100644
--- a/database/contexts/api_v1.c
+++ b/database/contexts/api_v1.c
@@ -366,7 +366,7 @@ int rrdcontext_to_json(RRDHOST *host, BUFFER *wb, time_t after, time_t before, R
RRDCONTEXT *rc = rrdcontext_acquired_value(rca);
if(after != 0 && before != 0)
- rrdr_relative_window_to_absolute(&after, &before, NULL, false);
+ rrdr_relative_window_to_absolute_query(&after, &before, NULL, false);
buffer_json_initialize(wb, "\"", "\"", 0, true, BUFFER_JSON_OPTIONS_DEFAULT);
struct rrdcontext_to_json t_contexts = {
@@ -403,7 +403,7 @@ int rrdcontexts_to_json(RRDHOST *host, BUFFER *wb, time_t after, time_t before,
uuid_unparse(*host->node_id, node_uuid);
if(after != 0 && before != 0)
- rrdr_relative_window_to_absolute(&after, &before, NULL, false);
+ rrdr_relative_window_to_absolute_query(&after, &before, NULL, false);
buffer_json_initialize(wb, "\"", "\"", 0, true, BUFFER_JSON_OPTIONS_DEFAULT);
buffer_json_member_add_string(wb, "hostname", rrdhost_hostname(host));
diff --git a/database/contexts/api_v2.c b/database/contexts/api_v2.c
index dacf962a30..5d2eb68d2c 100644
--- a/database/contexts/api_v2.c
+++ b/database/contexts/api_v2.c
@@ -1940,7 +1940,9 @@ int rrdcontext_to_json_v2(BUFFER *wb, struct api_v2_contexts_request *req, CONTE
}
if(req->after || req->before) {
- ctl.window.relative = rrdr_relative_window_to_absolute(&ctl.window.after, &ctl.window.before, &ctl.now, false);
+ ctl.window.relative = rrdr_relative_window_to_absolute_query(&ctl.window.after, &ctl.window.before, &ctl.now
+ , false
+ );
ctl.window.enabled = !(mode & CONTEXTS_V2_ALERT_TRANSITIONS);
}
else
diff --git a/database/contexts/query_target.c b/database/contexts/query_target.c
index 829640b909..d969691dde 100644
--- a/database/contexts/query_target.c
+++ b/database/contexts/query_target.c
@@ -1052,8 +1052,9 @@ QUERY_TARGET *query_target_create(QUERY_TARGET_REQUEST *qtr) {
if(query_target_has_percentage_of_group(qt))
qt->window.options &= ~RRDR_OPTION_PERCENTAGE;
- qt->internal.relative = rrdr_relative_window_to_absolute(&qt->window.after, &qt->window.before, &qt->window.now,
- unittest_running);
+ qt->internal.relative = rrdr_relative_window_to_absolute_query(&qt->window.after, &qt->window.before
+ , &qt->window.now, unittest_running
+ );
// prepare our local variables - we need these across all these functions
QUERY_TARGET_LOCALS qtl = {