mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-30 03:01:58 -04:00
refactor: simplify ProofTaskMetrics default implementation
- Updated the ProofTaskMetrics struct to derive Default, removing the manual implementation of the default method. - This change enhances code clarity and reduces boilerplate, while maintaining the same functionality.
This commit is contained in:
@@ -5,7 +5,7 @@ use std::sync::{
|
||||
};
|
||||
|
||||
/// Metrics for blinded node fetching by proof workers.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct ProofTaskMetrics {
|
||||
/// The actual metrics for blinded nodes.
|
||||
pub task_metrics: ProofTaskTrieMetrics,
|
||||
@@ -19,18 +19,6 @@ pub struct ProofTaskMetrics {
|
||||
pub storage_nodes: Arc<AtomicU64>,
|
||||
}
|
||||
|
||||
impl Default for ProofTaskMetrics {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
task_metrics: ProofTaskTrieMetrics::default(),
|
||||
storage_proofs: Arc::new(AtomicU64::new(0)),
|
||||
account_proofs: Arc::new(AtomicU64::new(0)),
|
||||
account_nodes: Arc::new(AtomicU64::new(0)),
|
||||
storage_nodes: Arc::new(AtomicU64::new(0)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ProofTaskMetrics {
|
||||
/// Record the blinded node counts into the histograms.
|
||||
pub fn record(&self) {
|
||||
|
||||
Reference in New Issue
Block a user