pub struct ConfigValueGroup {
pub enabled: bool,
pub sample_interval: Duration,
pub log_path: Option<TemplatedPathBuf>,
}Expand description
ConfigValueGroup struct containing all configurable values
Fields§
§enabled: boolWhether to enable system resource monitoring.
When enabled, the system monitor will periodically sample and log system statistics such as CPU usage, memory usage, and other resource metrics.
The default value is false.
Use the environment variable HF_XET_SYSTEM_MONITOR_ENABLED to set this value.
sample_interval: DurationThe interval at which to sample system statistics.
The default value is 5 seconds.
Use the environment variable HF_XET_SYSTEM_MONITOR_SAMPLE_INTERVAL to set this value.
log_path: Option<TemplatedPathBuf>The path to write the system monitor output to.
If not set, the output will be written to tracing log at “INFO” level.
Supports template variables (case-insensitive):
{PID}- Replaced with the current process ID{TIMESTAMP}- Replaced with ISO 8601 timestamp in local timezone with offset (e.g.,2024-02-05T14-30-45-0500)
Example: ~/logs/monitor_{PID}_{TIMESTAMP}.log
The default value is None.
Use the environment variable HF_XET_SYSTEM_MONITOR_LOG_PATH to set this value.
Implementations§
Source§impl ConfigValueGroup
impl ConfigValueGroup
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new instance with default values only (no environment variable overrides).
Sourcepub fn apply_env_overrides(&mut self)
pub fn apply_env_overrides(&mut self)
Apply environment variable overrides to this configuration group.
The group name is derived from the module path. For example, in module xet_config::groups::data,
the env var for TEST_INT would be HF_XET_DATA_TEST_INT.
Sourcepub fn field_names() -> &'static [&'static str]
pub fn field_names() -> &'static [&'static str]
Returns the list of field names in this configuration group.
Trait Implementations§
Source§impl AsRef<ConfigValueGroup> for ConfigValueGroup
impl AsRef<ConfigValueGroup> for ConfigValueGroup
Source§fn as_ref(&self) -> &ConfigValueGroup
fn as_ref(&self) -> &ConfigValueGroup
Source§impl Clone for ConfigValueGroup
impl Clone for ConfigValueGroup
Source§fn clone(&self) -> ConfigValueGroup
fn clone(&self) -> ConfigValueGroup
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more