master
h 67 lines 1.65 KB
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 #ifndef NETDATA_SYSTEMD_JOURNAL_FUNCTION_H
4 #define NETDATA_SYSTEMD_JOURNAL_FUNCTION_H
5
6 #define ND_SD_JOURNAL_SAMPLING_SLOTS 1000
7 #define ND_SD_JOURNAL_SAMPLING_RECALIBRATE 10000
8
9 #define FACET_MAX_VALUE_LENGTH 8192
10 #define ND_SD_JOURNAL_DEFAULT_TIMEOUT 60
11 #define ND_SD_JOURNAL_PROGRESS_EVERY_UT (250 * USEC_PER_MS)
12
13 #define JOURNAL_DEFAULT_DIRECTION FACETS_ANCHOR_DIRECTION_BACKWARD
14
15 #define JD_SOURCE_REALTIME_TIMESTAMP "_SOURCE_REALTIME_TIMESTAMP"
16
17 // structures needed by LQS
18 struct lqs_extension {
19 struct {
20 usec_t start_ut;
21 usec_t stop_ut;
22 usec_t first_msg_ut;
23
24 NsdId128 first_msg_writer;
25 uint64_t first_msg_seqnum;
26 } query_file;
27
28 struct {
29 uint32_t enable_after_samples;
30 uint32_t slots;
31 uint32_t sampled;
32 uint32_t unsampled;
33 uint32_t estimated;
34 } samples;
35
36 struct {
37 uint32_t enable_after_samples;
38 uint32_t every;
39 uint32_t skipped;
40 uint32_t recalibrate;
41 uint32_t sampled;
42 uint32_t unsampled;
43 uint32_t estimated;
44 } samples_per_file;
45
46 struct {
47 usec_t start_ut;
48 usec_t end_ut;
49 usec_t step_ut;
50 uint32_t enable_after_samples;
51 uint32_t sampled[ND_SD_JOURNAL_SAMPLING_SLOTS];
52 uint32_t unsampled[ND_SD_JOURNAL_SAMPLING_SLOTS];
53 } samples_per_time_slot;
54
55 // per file progress info
56 // size_t cached_count;
57
58 // progress statistics
59 usec_t matches_setup_ut;
60 size_t rows_useful;
61 size_t rows_read;
62 size_t bytes_read;
63 size_t files_matched;
64 size_t file_working;
65 };
66
67 #endif //NETDATA_SYSTEMD_JOURNAL_FUNCTION_H