Skip to main content

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, ParameterScope};
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(0),
20    "How frequently to refresh lgalloc stats. A zero duration disables refreshing.",
21    ParameterScope::Replica,
22);
23
24/// How frequently to refresh lgalloc stats.
25pub(crate) const MZ_METRICS_LGALLOC_REFRESH_INTERVAL: Config<Duration> = Config::new(
26    "mz_metrics_lgalloc_refresh_interval",
27    Duration::from_secs(30),
28    "How frequently to refresh lgalloc stats. A zero duration disables refreshing.",
29    ParameterScope::Replica,
30);
31
32/// How frequently to refresh lgalloc stats.
33pub(crate) const MZ_METRICS_RUSAGE_REFRESH_INTERVAL: Config<Duration> = Config::new(
34    "mz_metrics_rusage_refresh_interval",
35    Duration::from_secs(30),
36    "How frequently to refresh rusage stats. A zero duration disables refreshing.",
37    ParameterScope::Replica,
38);
39
40/// Adds the full set of all storage `Config`s.
41pub fn all_dyncfgs(configs: ConfigSet) -> ConfigSet {
42    configs
43        .add(&MZ_METRICS_LGALLOC_MAP_REFRESH_INTERVAL)
44        .add(&MZ_METRICS_LGALLOC_REFRESH_INTERVAL)
45        .add(&MZ_METRICS_RUSAGE_REFRESH_INTERVAL)
46}