Skip to content

Commit 901e3ef

Browse files
vigithyhl25
andauthored
chore: refactor config (numaproj#2873)
Signed-off-by: Vigith Maurice <vigith@gmail.com> Signed-off-by: Yashash H L <yashashhl25@gmail.com> Co-authored-by: Yashash H L <yashashhl25@gmail.com>
1 parent 5a779d9 commit 901e3ef

15 files changed

Lines changed: 4247 additions & 4285 deletions

File tree

rust/numaflow-core/src/config/components.rs

Lines changed: 794 additions & 4038 deletions
Large diffs are not rendered by default.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const DEFAULT_METRICS_PORT: u16 = 2469;
2+
const DEFAULT_LAG_CHECK_INTERVAL_IN_SECS: u16 = 5;
3+
const DEFAULT_LAG_REFRESH_INTERVAL_IN_SECS: u16 = 3;
4+
const DEFAULT_LOOKBACK_WINDOW_IN_SECS: u16 = 120;
5+
6+
#[derive(Debug, Clone, PartialEq)]
7+
pub(crate) struct MetricsConfig {
8+
// TODO(lookback) - using new implementation for monovertex right now,
9+
// remove extra fields from here once new corresponding pipeline changes
10+
// in the daemon are done.
11+
pub metrics_server_listen_port: u16,
12+
pub lag_check_interval_in_secs: u16,
13+
pub lag_refresh_interval_in_secs: u16,
14+
pub lookback_window_in_secs: u16,
15+
}
16+
17+
impl Default for MetricsConfig {
18+
fn default() -> Self {
19+
Self {
20+
metrics_server_listen_port: DEFAULT_METRICS_PORT,
21+
lag_check_interval_in_secs: DEFAULT_LAG_CHECK_INTERVAL_IN_SECS,
22+
lag_refresh_interval_in_secs: DEFAULT_LAG_REFRESH_INTERVAL_IN_SECS,
23+
lookback_window_in_secs: DEFAULT_LOOKBACK_WINDOW_IN_SECS,
24+
}
25+
}
26+
}
27+
28+
impl MetricsConfig {
29+
pub(crate) fn with_lookback_window_in_secs(lookback_window_in_secs: u16) -> Self {
30+
MetricsConfig {
31+
lookback_window_in_secs,
32+
..Default::default()
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)