mz_metrics/
dyncfgs.rs

1// Copyright Materialize, Inc. and contributors. All rights reserved.
2//
3// Use of this software is governed by the Business Source License
4// included in the LICENSE file.
5//
6// As of the Change Date specified in that file, in accordance with
7// the Business Source License, use of this software will be governed
8// by the Apache License, Version 2.0.
9
10//! Dyncfgs used by mz-metrics.
11
12use std::time::Duration;
13
14use mz_dyncfg::{Config, ConfigSet};
15
16/// How frequently to refresh lgalloc map stats.
17pub(crate) const MZ_METRICS_LGALLOC_MAP_REFRESH_INTERVAL: Config<Duration> = Config::new(
18    "mz_metrics_lgalloc_map_refresh_interval",
19    Duration::from_secs(600),
20    "How frequently to refresh lgalloc stats. A zero duration disables refreshing.",
21);
22
23/// How frequently to refresh lgalloc stats.
24pub(crate) const MZ_METRICS_LGALLOC_REFRESH_INTERVAL: Config<Duration> = Config::new(
25    "mz_metrics_lgalloc_refresh_interval",
26    Duration::from_secs(30),
27    "How frequently to refresh lgalloc stats. A zero duration disables refreshing.",
28);
29
30/// How frequently to refresh lgalloc stats.
31pub(crate) const MZ_METRICS_RUSAGE_REFRESH_INTERVAL: Config<Duration> = Config::new(
32    "mz_metrics_rusage_refresh_interval",
33    Duration::from_secs(30),
34    "How frequently to refresh rusage stats. A zero duration disables refreshing.",
35);
36
37/// Adds the full set of all storage `Config`s.
38pub fn all_dyncfgs(configs: ConfigSet) -> ConfigSet {
39    configs
40        .add(&MZ_METRICS_LGALLOC_MAP_REFRESH_INTERVAL)
41        .add(&MZ_METRICS_LGALLOC_REFRESH_INTERVAL)
42        .add(&MZ_METRICS_RUSAGE_REFRESH_INTERVAL)
43}