-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathdoris.rs
More file actions
44 lines (37 loc) · 1.27 KB
/
doris.rs
File metadata and controls
44 lines (37 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use metrics::counter;
use vector_lib::{NamedInternalEvent, internal_event::InternalEvent};
/// Emitted when rows are successfully loaded into Doris.
#[derive(Debug, NamedInternalEvent)]
pub struct DorisRowsLoaded {
pub loaded_rows: i64,
pub load_bytes: i64,
}
impl InternalEvent for DorisRowsLoaded {
fn emit(self) {
trace!(
message = "Doris rows loaded successfully.",
loaded_rows = %self.loaded_rows,
load_bytes = %self.load_bytes,
internal_log_rate_limit = true
);
// Record the number of rows loaded
counter!("doris_rows_loaded_total").increment(self.loaded_rows as u64);
// Record the number of bytes loaded
counter!("doris_bytes_loaded_total").increment(self.load_bytes as u64);
}
}
/// Emitted when rows are filtered by Doris during loading.
#[derive(Debug, NamedInternalEvent)]
pub struct DorisRowsFiltered {
pub filtered_rows: i64,
}
impl InternalEvent for DorisRowsFiltered {
fn emit(self) {
warn!(
message = "Doris rows filtered during loading.",
filtered_rows = %self.filtered_rows,
internal_log_rate_limit = true
);
counter!("doris_rows_filtered_total").increment(self.filtered_rows as u64);
}
}