#[non_exhaustive]pub enum Event {
Show 14 variants
Started,
RequestStarted {
request: RequestInfo,
},
Fetched {
request: RequestInfo,
status: Option<StatusCode>,
latency: Duration,
},
Handled {
request: RequestInfo,
outcome: OutcomeKind,
error: Option<Failure>,
elapsed: Duration,
},
Retried {
request: RequestInfo,
after: Option<Duration>,
},
Failed {
request: RequestInfo,
},
Skipped {
request: RequestInfo,
reason: SkipReason,
},
Cancelled {
request: RequestInfo,
},
HostSlowed {
host: String,
slowdown: Slowdown,
},
HostPaused {
host: String,
duration: Duration,
},
RobotsFetched {
origin: String,
error: Option<Failure>,
},
Stopping {
reason: StopReason,
},
Finished {
stats: Stats,
},
Lagged {
missed: u64,
},
}Expand description
Something that happened in a crawl, as Crawler::events reports it.
Every request reports RequestStarted, then
Fetched for each fetch its handlers made, then
Handled once they returned. After that, it is
Retried or Failed if it did not
succeed. A request still running when the shutdown grace period ends is
Cancelled instead of handled.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Started
The run started.
RequestStarted
A request started: its client is connecting.
Fields
request: RequestInfoThe request.
Fetched
A request was fetched, when its handlers first asked for the response. A failed fetch is reported too, and fetched again if a handler asks again.
Fields
request: RequestInfoThe request.
status: Option<StatusCode>The status the server answered with, also when the backend
failed the fetch for it, e.g. a 404; None if no response
came, e.g. the connection failed.
Handled
A request’s handlers returned.
Fields
request: RequestInfoThe request.
outcome: OutcomeKindWhat the handlers returned.
error: Option<Failure>Why the request failed, for OutcomeKind::Fail and
OutcomeKind::Fatal.
Retried
The frontier took a request back for another attempt.
Fields
request: RequestInfoThe attempt that failed.
Failed
A request failed for good: not retryable, out of retries, or refused a retry by the frontier.
Fields
request: RequestInfoThe request.
Skipped
A request was not crawled on purpose.
Cancelled
A request was still in flight when the shutdown grace period ended.
Fields
request: RequestInfoThe request.
HostSlowed
A host was throttled, and the crawl slowed down on it.
Fields
HostPaused
A host asked to be left alone, with Retry-After, and nothing
starts on it for a while.
Fields
RobotsFetched
An origin’s robots.txt was fetched, or could not be.
Fields
Stopping
The run is stopping: nothing new starts, and requests in flight finish.
Fields
reason: StopReasonWhy the run stops.
Finished
The run finished, with its totals.
Lagged
This subscriber fell behind and missed events, which were dropped for it; the crawl is never slowed down for a subscriber.