pub struct MetricsSnapshot {Show 32 fields
pub requests_enqueued: usize,
pub requests_sent: usize,
pub requests_succeeded: usize,
pub requests_failed: usize,
pub requests_retried: usize,
pub requests_scheduled_for_retry: usize,
pub requests_dropped: usize,
pub retry_delay_in_flight_ms: u64,
pub responses_received: usize,
pub responses_from_cache: usize,
pub total_bytes_downloaded: usize,
pub items_scraped: usize,
pub items_processed: usize,
pub items_dropped_by_pipeline: usize,
pub queue_depth: usize,
pub parser_backlog: usize,
pub pipeline_backlog: usize,
pub retry_backlog: usize,
pub response_status_counts: HashMap<u16, usize>,
pub elapsed_duration: Duration,
pub average_request_time: Option<Duration>,
pub fastest_request_time: Option<Duration>,
pub slowest_request_time: Option<Duration>,
pub request_time_count: usize,
pub average_parsing_time: Option<Duration>,
pub fastest_parsing_time: Option<Duration>,
pub slowest_parsing_time: Option<Duration>,
pub parsing_time_count: usize,
pub recent_requests_per_second: f64,
pub recent_responses_per_second: f64,
pub recent_items_per_second: f64,
pub current_item_preview: String,
}Expand description
Point-in-time snapshot of crawler metrics for reporting and export.
Fields§
§requests_enqueued: usize§requests_sent: usize§requests_succeeded: usize§requests_failed: usize§requests_retried: usize§requests_scheduled_for_retry: usize§requests_dropped: usize§retry_delay_in_flight_ms: u64§responses_received: usize§responses_from_cache: usize§total_bytes_downloaded: usize§items_scraped: usize§items_processed: usize§items_dropped_by_pipeline: usize§queue_depth: usize§parser_backlog: usize§pipeline_backlog: usize§retry_backlog: usize§response_status_counts: HashMap<u16, usize>§elapsed_duration: Duration§average_request_time: Option<Duration>§fastest_request_time: Option<Duration>§slowest_request_time: Option<Duration>§request_time_count: usize§average_parsing_time: Option<Duration>§fastest_parsing_time: Option<Duration>§slowest_parsing_time: Option<Duration>§parsing_time_count: usize§recent_requests_per_second: f64§recent_responses_per_second: f64§recent_items_per_second: f64§current_item_preview: StringImplementations§
Source§impl MetricsSnapshot
impl MetricsSnapshot
Sourcepub fn formatted_duration(&self) -> String
pub fn formatted_duration(&self) -> String
Formats Self::elapsed_duration into a human-readable string.
Sourcepub fn formatted_request_time(&self, duration: Option<Duration>) -> String
pub fn formatted_request_time(&self, duration: Option<Duration>) -> String
Formats an optional request duration for display.
Sourcepub fn requests_per_second(&self) -> f64
pub fn requests_per_second(&self) -> f64
Returns average sent requests per second over total elapsed duration.
Sourcepub fn responses_per_second(&self) -> f64
pub fn responses_per_second(&self) -> f64
Returns average received responses per second over total elapsed duration.
Sourcepub fn items_per_second(&self) -> f64
pub fn items_per_second(&self) -> f64
Returns average scraped items per second over total elapsed duration.
Sourcepub fn bytes_per_second(&self) -> f64
pub fn bytes_per_second(&self) -> f64
Returns average downloaded bytes per second over total elapsed duration.
Sourcepub fn formatted_bytes(&self) -> String
pub fn formatted_bytes(&self) -> String
Formats Self::total_bytes_downloaded into a human-readable size string.
Sourcepub fn formatted_bytes_per_second(&self) -> String
pub fn formatted_bytes_per_second(&self) -> String
Formats Self::bytes_per_second into a human-readable rate string.
Trait Implementations§
Source§impl Clone for MetricsSnapshot
impl Clone for MetricsSnapshot
Source§fn clone(&self) -> MetricsSnapshot
fn clone(&self) -> MetricsSnapshot
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MetricsSnapshot
impl Debug for MetricsSnapshot
Source§impl MetricsSnapshotProvider for MetricsSnapshot
impl MetricsSnapshotProvider for MetricsSnapshot
fn get_requests_enqueued(&self) -> usize
fn get_requests_sent(&self) -> usize
fn get_requests_succeeded(&self) -> usize
fn get_requests_failed(&self) -> usize
fn get_requests_retried(&self) -> usize
fn get_requests_scheduled_for_retry(&self) -> usize
fn get_requests_dropped(&self) -> usize
fn get_retry_delay_in_flight_ms(&self) -> u64
fn get_responses_received(&self) -> usize
fn get_responses_from_cache(&self) -> usize
fn get_total_bytes_downloaded(&self) -> usize
fn get_items_scraped(&self) -> usize
fn get_items_processed(&self) -> usize
fn get_items_dropped_by_pipeline(&self) -> usize
fn get_queue_depth(&self) -> usize
fn get_parser_backlog(&self) -> usize
fn get_pipeline_backlog(&self) -> usize
fn get_retry_backlog(&self) -> usize
fn get_response_status_counts(&self) -> &HashMap<u16, usize>
fn get_elapsed_duration(&self) -> Duration
fn get_average_request_time(&self) -> Option<Duration>
fn get_fastest_request_time(&self) -> Option<Duration>
fn get_slowest_request_time(&self) -> Option<Duration>
fn get_request_time_count(&self) -> usize
fn get_average_parsing_time(&self) -> Option<Duration>
fn get_fastest_parsing_time(&self) -> Option<Duration>
fn get_slowest_parsing_time(&self) -> Option<Duration>
fn get_parsing_time_count(&self) -> usize
fn get_recent_requests_per_second(&self) -> f64
fn get_recent_responses_per_second(&self) -> f64
fn get_recent_items_per_second(&self) -> f64
fn get_current_item_preview(&self) -> &str
fn formatted_duration(&self) -> String
fn formatted_request_time(&self, duration: Option<Duration>) -> String
fn formatted_bytes(&self) -> String
Auto Trait Implementations§
impl Freeze for MetricsSnapshot
impl RefUnwindSafe for MetricsSnapshot
impl Send for MetricsSnapshot
impl Sync for MetricsSnapshot
impl Unpin for MetricsSnapshot
impl UnwindSafe for MetricsSnapshot
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