oa_gateway/config/
engine.rs

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
//! `[engine]` section: process-wide router reporting.
//!
//! The engine itself has no config. This section only controls how the
//! host talks about it.

use serde::Deserialize;

/// Host-side engine reporting.
#[derive(Debug, Deserialize)]
#[serde(deny_unknown_fields)]
pub(crate) struct EngineSection {
    /// Seconds between `EngineStats` log lines. `0` disables the ticker.
    /// Defaults to `30`.
    #[serde(default = "default_stats_interval_secs")]
    pub(crate) stats_interval_secs: u64,
}

impl Default for EngineSection {
    fn default() -> Self {
        Self {
            stats_interval_secs: default_stats_interval_secs(),
        }
    }
}

fn default_stats_interval_secs() -> u64 {
    30
}