Skip to content

Commit

Permalink
pr feedback: remove report_metrics helper fn
Browse files Browse the repository at this point in the history
  • Loading branch information
AshwinSekar committed Jul 17, 2024
1 parent fbbf17e commit acac298
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions ledger/src/blockstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,26 +181,7 @@ pub struct LastFECSetCheckResults {
}

impl LastFECSetCheckResults {
pub fn report_metrics(&self, slot: Slot, bank_hash: Hash, cluster_type: ClusterType) {
if self.block_id.is_none() {
datapoint_warn!(
"incomplete_final_fec_set",
("slot", slot, i64),
("bank_hash", bank_hash.to_string(), String)
);
}
// These metrics are expensive to send because hash does not compress well.
// Only send these metrics when we are sure the appropriate shred format is being sent
if !self.is_retransmitter_signed && shred::should_chain_merkle_shreds(slot, cluster_type) {
datapoint_warn!(
"invalid_retransmitter_signature_final_fec_set",
("slot", slot, i64),
("bank_hash", bank_hash.to_string(), String)
);
}
}

pub fn get_block_id(
fn get_block_id(
&self,
feature_set: &FeatureSet,
) -> std::result::Result<Option<Hash>, BlockstoreProcessorError> {
Expand Down Expand Up @@ -3754,7 +3735,18 @@ impl Blockstore {
return Ok(None);
};
// Update metrics
results.report_metrics(slot, bank_hash, cluster_type);
if results.block_id.is_none() {
datapoint_warn!("incomplete_final_fec_set", ("slot", slot, i64),);
}
// These metrics are expensive to send because hash does not compress well.
// Only send these metrics when we are sure the appropriate shred format is being sent
if !results.is_retransmitter_signed && shred::should_chain_merkle_shreds(slot, cluster_type)
{
datapoint_warn!(
"invalid_retransmitter_signature_final_fec_set",
("slot", slot, i64),
);
}
// Return block id / error based on feature flags
results.get_block_id(feature_set)
}
Expand Down

0 comments on commit acac298

Please sign in to comment.