pub struct BlockchainSyncReporter { /* private fields */ }
Expand description
Tracks performance metrics during block synchronization
Implementations§
Source§impl BlockchainSyncReporter
impl BlockchainSyncReporter
Sourcepub fn new(
item: BlockchainSyncReportItems,
from_block: u64,
total_blocks: u64,
update_interval: u64,
) -> Self
pub fn new( item: BlockchainSyncReportItems, from_block: u64, total_blocks: u64, update_interval: u64, ) -> Self
Creates a new metrics tracker for block synchronization
Sourcepub fn should_log_progress(&self, block_number: u64, current_block: u64) -> bool
pub fn should_log_progress(&self, block_number: u64, current_block: u64) -> bool
Checks if progress should be logged based on the current block number
Sourcepub fn log_progress(&mut self, block_number: u64)
pub fn log_progress(&mut self, block_number: u64)
Logs current progress with detailed metrics
Sourcepub fn log_final_stats(&self)
pub fn log_final_stats(&self)
Logs final statistics summary
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BlockchainSyncReporter
impl RefUnwindSafe for BlockchainSyncReporter
impl Send for BlockchainSyncReporter
impl Sync for BlockchainSyncReporter
impl Unpin for BlockchainSyncReporter
impl UnwindSafe for BlockchainSyncReporter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more