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