pub struct StatCollector {Show 15 fields
pub start_time: Instant,
pub requests_enqueued: AtomicUsize,
pub requests_sent: AtomicUsize,
pub requests_succeeded: AtomicUsize,
pub requests_failed: AtomicUsize,
pub requests_retried: AtomicUsize,
pub requests_dropped: AtomicUsize,
pub responses_received: AtomicUsize,
pub responses_from_cache: AtomicUsize,
pub response_status_counts: Arc<DashMap<u16, usize>>,
pub total_bytes_downloaded: AtomicUsize,
pub items_scraped: AtomicUsize,
pub items_processed: AtomicUsize,
pub items_dropped_by_pipeline: AtomicUsize,
pub request_times: Arc<DashMap<String, Duration>>,
}Expand description
Collects and stores various statistics about the crawler’s operation.
Fields§
§start_time: Instant§requests_enqueued: AtomicUsize§requests_sent: AtomicUsize§requests_succeeded: AtomicUsize§requests_failed: AtomicUsize§requests_retried: AtomicUsize§requests_dropped: AtomicUsize§responses_received: AtomicUsize§responses_from_cache: AtomicUsize§response_status_counts: Arc<DashMap<u16, usize>>§total_bytes_downloaded: AtomicUsize§items_scraped: AtomicUsize§items_processed: AtomicUsize§items_dropped_by_pipeline: AtomicUsize§request_times: Arc<DashMap<String, Duration>>Implementations§
Source§impl StatCollector
impl StatCollector
Sourcepub fn to_json_string(&self) -> Result<String, SpiderError>
pub fn to_json_string(&self) -> Result<String, SpiderError>
Converts the snapshot into a JSON string.
Sourcepub fn to_json_string_pretty(&self) -> Result<String, SpiderError>
pub fn to_json_string_pretty(&self) -> Result<String, SpiderError>
Converts the snapshot into a pretty-printed JSON string.
Sourcepub fn to_markdown_string(&self) -> String
pub fn to_markdown_string(&self) -> String
Exports the current statistics to a Markdown formatted string.
Trait Implementations§
Source§impl Debug for StatCollector
impl Debug for StatCollector
Source§impl Default for StatCollector
impl Default for StatCollector
Source§fn default() -> StatCollector
fn default() -> StatCollector
Returns the “default value” for a type. Read more
Source§impl Display for StatCollector
impl Display for StatCollector
Source§impl Serialize for StatCollector
impl Serialize for StatCollector
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl !Freeze for StatCollector
impl !RefUnwindSafe for StatCollector
impl Send for StatCollector
impl Sync for StatCollector
impl Unpin for StatCollector
impl !UnwindSafe for StatCollector
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> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.