sui_core/module_cache_metrics.rs
1// Copyright (c) Mysten Labs, Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4use prometheus::{IntGauge, Registry, register_int_gauge_with_registry};
5
6pub struct ResolverMetrics {
7 /// Track the size of the module cache.
8 pub module_cache_size: IntGauge,
9}
10
11impl ResolverMetrics {
12 pub fn new(registry: &Registry) -> Self {
13 Self {
14 module_cache_size: register_int_gauge_with_registry!(
15 "module_cache_size",
16 "Number of compiled move modules in the authority's cache.",
17 registry
18 )
19 .unwrap(),
20 }
21 }
22}