iota_config/
validator_client_monitor_config.rs1use std::time::Duration;
16
17use serde::{Deserialize, Serialize};
18
19#[derive(Debug, Clone, Serialize, Deserialize)]
21#[serde(rename_all = "kebab-case")]
22pub struct ValidatorClientMonitorConfig {
23 #[serde(default = "default_health_check_interval")]
25 pub health_check_interval: Duration,
26
27 #[serde(default = "default_health_check_timeout")]
29 pub health_check_timeout: Duration,
30
31 #[serde(default = "default_exploitation_group_share")]
34 pub exploitation_group_share: usize,
35
36 #[serde(default = "default_exploration_group_share")]
39 pub exploration_group_share: usize,
40}
41
42impl Default for ValidatorClientMonitorConfig {
43 fn default() -> Self {
44 Self {
45 health_check_interval: default_health_check_interval(),
46 health_check_timeout: default_health_check_timeout(),
47 exploitation_group_share: default_exploitation_group_share(),
48 exploration_group_share: default_exploration_group_share(),
49 }
50 }
51}
52
53fn default_health_check_interval() -> Duration {
54 Duration::from_secs(10)
55}
56
57fn default_health_check_timeout() -> Duration {
58 Duration::from_secs(2)
59}
60
61fn default_exploitation_group_share() -> usize {
62 10
63}
64
65fn default_exploration_group_share() -> usize {
66 10
67}