pub struct ProgressIndicatorService { /* private fields */ }Expand description
Real-time progress indicator for user feedback during pipeline processing.
This provides immediate visual feedback to users about processing progress, separate from logging and metrics systems. It writes directly to the terminal with real-time updates on the same line.
§Design Principles
- User-Focused: Provides immediate visual feedback for end users
- Non-Logging: Writes directly to terminal, not through logging system
- Real-Time: Updates as chunks are processed, not batched
- Concurrent-Safe: Thread-safe for concurrent chunk processing
- Minimal Overhead: Lightweight to avoid impacting performance
§Example Output
Wrote Id: 000097/Completed: 002000§Usage
Implementations§
Source§impl ProgressIndicatorService
impl ProgressIndicatorService
Sourcepub async fn update_progress(&self, chunk_id: u64)
pub async fn update_progress(&self, chunk_id: u64)
Updates progress when a chunk has been successfully written.
This method is thread-safe and can be called concurrently from multiple chunk processing tasks.
§Arguments
chunk_id- ID of the chunk that was just written
§Performance
Updates are throttled to avoid excessive terminal I/O during high-throughput processing.
Sourcepub async fn show_completion(
&self,
_bytes_processed: u64,
_throughput_mb_s: f64,
_total_duration: Duration,
)
pub async fn show_completion( &self, _bytes_processed: u64, _throughput_mb_s: f64, _total_duration: Duration, )
Shows the final completion summary.
This replaces the progress indicator with a comprehensive summary of the processing results.
§Arguments
bytes_processed- Total bytes processedthroughput_mb_s- Processing throughput in MB/stotal_duration- Total time taken for processing
Sourcepub async fn show_error_summary(&self, error_message: &str)
pub async fn show_error_summary(&self, error_message: &str)
Shows an error summary if processing fails.
§Arguments
error_message- Description of what went wrong
Sourcepub fn progress_percentage(&self) -> f64
pub fn progress_percentage(&self) -> f64
Trait Implementations§
impl Send for ProgressIndicatorService
impl Sync for ProgressIndicatorService
Auto Trait Implementations§
impl Freeze for ProgressIndicatorService
impl !RefUnwindSafe for ProgressIndicatorService
impl Unpin for ProgressIndicatorService
impl !UnwindSafe for ProgressIndicatorService
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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