Move BlockstoreInsertionMetrics field update to blockstore.rs (#28991)

The num_repair field is only blockstore insertion metric being updated
outside of Blockstore::insert() call chain; move the update to insert()
with the rest of the fields in BlockstoreInsertionMetrics struct.
This commit is contained in:
steviez 2022-11-30 11:46:35 -06:00 committed by GitHub
parent edacd3c411
commit b6dce6cf3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -276,7 +276,7 @@ where
prune_shreds_elapsed.stop();
ws_metrics.prune_shreds_elapsed_us += prune_shreds_elapsed.as_us();
let (completed_data_sets, inserted_indices) = blockstore.insert_shreds_handle_duplicate(
let (completed_data_sets, _) = blockstore.insert_shreds_handle_duplicate(
shreds,
repairs,
Some(leader_schedule_cache),
@ -286,11 +286,6 @@ where
reed_solomon_cache,
metrics,
)?;
for index in inserted_indices {
if repair_infos[index].is_some() {
metrics.num_repair += 1;
}
}
completed_data_sets_sender.try_send(completed_data_sets)?;
Ok(())

View File

@ -857,6 +857,9 @@ impl Blockstore {
error!("blockstore error: {}", err);
}
Ok(completed_data_sets) => {
if is_repaired {
metrics.num_repair += 1;
}
newly_completed_data_sets.extend(completed_data_sets);
inserted_indices.push(i);
metrics.num_inserted += 1;