MetricsSnapshot

Struct MetricsSnapshot 

Source
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: String

Implementations§

Source§

impl MetricsSnapshot

Source

pub fn formatted_duration(&self) -> String

Formats Self::elapsed_duration into a human-readable string.

Source

pub fn formatted_request_time(&self, duration: Option<Duration>) -> String

Formats an optional request duration for display.

Source

pub fn requests_per_second(&self) -> f64

Returns average sent requests per second over total elapsed duration.

Source

pub fn responses_per_second(&self) -> f64

Returns average received responses per second over total elapsed duration.

Source

pub fn items_per_second(&self) -> f64

Returns average scraped items per second over total elapsed duration.

Source

pub fn bytes_per_second(&self) -> f64

Returns average downloaded bytes per second over total elapsed duration.

Source

pub fn formatted_bytes(&self) -> String

Formats Self::total_bytes_downloaded into a human-readable size string.

Source

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

Source§

fn clone(&self) -> MetricsSnapshot

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MetricsSnapshot

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl MetricsSnapshotProvider for MetricsSnapshot

Source§

fn get_requests_enqueued(&self) -> usize

Source§

fn get_requests_sent(&self) -> usize

Source§

fn get_requests_succeeded(&self) -> usize

Source§

fn get_requests_failed(&self) -> usize

Source§

fn get_requests_retried(&self) -> usize

Source§

fn get_requests_scheduled_for_retry(&self) -> usize

Source§

fn get_requests_dropped(&self) -> usize

Source§

fn get_retry_delay_in_flight_ms(&self) -> u64

Source§

fn get_responses_received(&self) -> usize

Source§

fn get_responses_from_cache(&self) -> usize

Source§

fn get_total_bytes_downloaded(&self) -> usize

Source§

fn get_items_scraped(&self) -> usize

Source§

fn get_items_processed(&self) -> usize

Source§

fn get_items_dropped_by_pipeline(&self) -> usize

Source§

fn get_queue_depth(&self) -> usize

Source§

fn get_parser_backlog(&self) -> usize

Source§

fn get_pipeline_backlog(&self) -> usize

Source§

fn get_retry_backlog(&self) -> usize

Source§

fn get_response_status_counts(&self) -> &HashMap<u16, usize>

Source§

fn get_elapsed_duration(&self) -> Duration

Source§

fn get_average_request_time(&self) -> Option<Duration>

Source§

fn get_fastest_request_time(&self) -> Option<Duration>

Source§

fn get_slowest_request_time(&self) -> Option<Duration>

Source§

fn get_request_time_count(&self) -> usize

Source§

fn get_average_parsing_time(&self) -> Option<Duration>

Source§

fn get_fastest_parsing_time(&self) -> Option<Duration>

Source§

fn get_slowest_parsing_time(&self) -> Option<Duration>

Source§

fn get_parsing_time_count(&self) -> usize

Source§

fn get_recent_requests_per_second(&self) -> f64

Source§

fn get_recent_responses_per_second(&self) -> f64

Source§

fn get_recent_items_per_second(&self) -> f64

Source§

fn get_current_item_preview(&self) -> &str

Source§

fn formatted_duration(&self) -> String

Source§

fn formatted_request_time(&self, duration: Option<Duration>) -> String

Source§

fn formatted_bytes(&self) -> String

Source§

impl Serialize for MetricsSnapshot

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more