Skip to content

Commit 46534d6

Browse files
committed
Fix compile error in snapshot metrics
1 parent 105b3b5 commit 46534d6

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

prometheus/src/snapshot_metrics.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
use crate::utils::{write_metric, Metric, MetricFamily};
2-
use solana_runtime::snapshot_archive_info::{SnapshotArchiveInfo, SnapshotArchiveInfoGetter};
2+
use solana_runtime::snapshot_archive_info::SnapshotArchiveInfoGetter;
33
use solana_runtime::snapshot_config::SnapshotConfig;
44
use solana_runtime::snapshot_utils;
5-
use solana_sdk::clock::Slot;
65
use std::io;
76

87
pub fn write_snapshot_metrics<W: io::Write>(
@@ -11,9 +10,7 @@ pub fn write_snapshot_metrics<W: io::Write>(
1110
) -> io::Result<()> {
1211
let full_snapshot_info = match snapshot_utils::get_highest_full_snapshot_archive_info(
1312
&snapshot_config.snapshot_archives_dir,
14-
)
15-
.map(|full_snapshot_info| full_snapshot_info.snapshot_archive_info())
16-
{
13+
) {
1714
Some(info) => info,
1815
None => return Ok(()),
1916
};
@@ -23,7 +20,7 @@ pub fn write_snapshot_metrics<W: io::Write>(
2320
name: "solana_snapshot_last_full_snapshot_slot",
2421
help: "The slot height of the most recent full snapshot",
2522
type_: "gauge",
26-
metrics: vec![Metric::new(full_snapshot_info.slot)],
23+
metrics: vec![Metric::new(full_snapshot_info.slot())],
2724
},
2825
)?;
2926

@@ -32,10 +29,8 @@ pub fn write_snapshot_metrics<W: io::Write>(
3229
let incremental_snapshot_info =
3330
match snapshot_utils::get_highest_incremental_snapshot_archive_info(
3431
&snapshot_config.snapshot_archives_dir,
35-
slot,
36-
)
37-
.map(|inc_snapshot_info| inc_snapshot_info.snapshot_archive_info())
38-
{
32+
full_snapshot_info.slot(),
33+
) {
3934
None => return Ok(()),
4035
Some(info) => info,
4136
};
@@ -45,7 +40,7 @@ pub fn write_snapshot_metrics<W: io::Write>(
4540
name: "solana_snapshot_last_incremental_snapshot_slot",
4641
help: "The slot height of the most recent incremental snapshot",
4742
type_: "gauge",
48-
metrics: vec![Metric::new(incremental_snapshot_info.slot)],
43+
metrics: vec![Metric::new(incremental_snapshot_info.slot())],
4944
},
5045
)
5146
}

0 commit comments

Comments
 (0)