Adds metrics for fastboot storages kept alive (#33222)

This commit is contained in:
Brooks 2023-09-13 09:28:19 -04:00 committed by GitHub
parent 5562f79cc5
commit c40e88aef9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 5 deletions

View File

@ -64,7 +64,7 @@ impl AccountsHashVerifier {
// To support fastboot, we must ensure the storages used in the latest POST snapshot are
// not recycled nor removed early. Hold an Arc of their AppendVecs to prevent them from
// expiring.
let mut last_snapshot_storages = None;
let mut fastboot_storages = None;
loop {
if exit.load(Ordering::Relaxed) {
break;
@ -92,6 +92,7 @@ impl AccountsHashVerifier {
.is_some()
.then(|| accounts_package.snapshot_storages.clone());
let slot = accounts_package.slot;
let (_, handling_time_us) = measure_us!(Self::process_accounts_package(
accounts_package,
&cluster_info,
@ -103,7 +104,13 @@ impl AccountsHashVerifier {
));
if let Some(snapshot_storages_for_fastboot) = snapshot_storages_for_fastboot {
last_snapshot_storages = Some(snapshot_storages_for_fastboot)
let num_storages = snapshot_storages_for_fastboot.len();
fastboot_storages = Some(snapshot_storages_for_fastboot);
datapoint_info!(
"fastboot",
("slot", slot, i64),
("num_storages", num_storages, i64),
);
}
datapoint_info!(
@ -122,14 +129,14 @@ impl AccountsHashVerifier {
("handling_time_us", handling_time_us, i64),
);
}
info!("AccountsHashVerifier has stopped");
debug!(
"Number of snapshot storages kept alive for fastboot: {}",
last_snapshot_storages
"Number of storages kept alive for fastboot: {}",
fastboot_storages
.as_ref()
.map(|storages| storages.len())
.unwrap_or(0)
);
info!("AccountsHashVerifier has stopped");
})
.unwrap();
Self {