Skip to content

Commit

Permalink
fix: Duration deserialize in config
Browse files Browse the repository at this point in the history
  • Loading branch information
rvql committed Oct 23, 2024
1 parent 880da56 commit c582bd6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions agent/src/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1781,6 +1781,7 @@ pub struct Limits {
pub max_memory: u64,
pub max_log_backhaul_rate: u32,
pub max_local_log_file_size: u32,
#[serde(with = "humantime_serde")]
pub local_log_retention: Duration,
}

Expand Down Expand Up @@ -1867,6 +1868,7 @@ impl Default for RelativeSysLoad {
#[serde(default)]
pub struct TxThroughput {
pub trigger_threshold: u64,
#[serde(with = "humantime_serde")]
pub throughput_monitoring_interval: Duration,
}

Expand All @@ -1893,6 +1895,7 @@ pub struct Tunning {
pub cpu_affinity: Vec<usize>,
pub process_scheduling_priority: usize,
pub idle_memory_trimming: bool,
#[serde(with = "humantime_serde")]
pub resource_monitoring_interval: Duration,
}

Expand All @@ -1911,7 +1914,9 @@ impl Default for Tunning {
#[serde(default)]
pub struct Ntp {
pub enabled: bool,
#[serde(with = "humantime_serde")]
pub max_drift: Duration,
#[serde(with = "humantime_serde")]
pub min_drift: Duration,
}

Expand All @@ -1928,7 +1933,9 @@ impl Default for Ntp {
#[derive(Clone, Debug, Deserialize, PartialEq, Eq)]
#[serde(default)]
pub struct Communication {
#[serde(with = "humantime_serde")]
pub proactive_request_interval: Duration,
#[serde(with = "humantime_serde")]
pub max_escape_duration: Duration,
pub ingester_ip: String,
pub ingester_port: u16,
Expand Down Expand Up @@ -2013,6 +2020,7 @@ pub struct SelfMonitoring {
pub profile: Profile,
pub debug: Debug,
pub hostname: String,
#[serde(with = "humantime_serde")]
pub interval: Duration,
}

Expand Down Expand Up @@ -2302,6 +2310,7 @@ pub struct Outputs {
#[derive(Clone, Default, Debug, Deserialize, PartialEq, Eq)]
#[serde(default)]
pub struct Plugins {
#[serde(with = "humantime_serde")]
pub update_time: Duration,
pub wasm_plugins: Vec<String>,
pub so_plugins: Vec<String>,
Expand Down

0 comments on commit c582bd6

Please sign in to comment.