summaryrefslogtreecommitdiffstats
path: root/collectors
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 /collectors
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 'collectors')
-rw-r--r--collectors/systemd-journal.plugin/systemd-journal.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/collectors/systemd-journal.plugin/systemd-journal.c b/collectors/systemd-journal.plugin/systemd-journal.c
index ea905a65c8..f0935b450f 100644
--- a/collectors/systemd-journal.plugin/systemd-journal.c
+++ b/collectors/systemd-journal.plugin/systemd-journal.c
@@ -2341,16 +2341,15 @@ static void function_systemd_journal(const char *transaction, char *function, in
// ------------------------------------------------------------------------
// validate parameters
- time_t expires = now_realtime_sec() + 1;
- time_t now_s;
+ time_t now_s = now_realtime_sec();
+ time_t expires = now_s + 1;
if(!after_s && !before_s) {
- now_s = now_realtime_sec();
before_s = now_s;
after_s = before_s - SYSTEMD_JOURNAL_DEFAULT_QUERY_DURATION;
}
else
- rrdr_relative_window_to_absolute(&after_s, &before_s, &now_s, false);
+ rrdr_relative_window_to_absolute(&after_s, &before_s, now_s);
if(after_s > before_s) {
time_t tmp = after_s;