Struct scylla::history::HistoryCollector

source ·
pub struct HistoryCollector { /* private fields */ }
Expand description

HistoryCollector can be used as HistoryListener to collect all the query history events. Each event is marked with an UTC timestamp.

Implementations§

source§

impl HistoryCollector

source

pub fn new() -> HistoryCollector

Creates a new HistoryCollector with empty data.

source

pub fn clone_collected(&self) -> HistoryCollectorData

Clones the data collected by the collector.

source

pub fn take_collected(&self) -> HistoryCollectorData

Takes the data out of the collector. The collected events are cleared.
It’s possible that after finishing a query and taking out the events new ones will still come - from queries that haven’t been cancelled yet.

source

pub fn clone_structured_history(&self) -> StructuredHistory

Clone the collected events and convert them to StructuredHistory.

source

pub fn take_structured_history(&self) -> StructuredHistory

Take the collected events out, just like in take_collected and convert them to StructuredHistory.

Trait Implementations§

source§

impl Debug for HistoryCollector

source§

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

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

impl Default for HistoryCollector

source§

fn default() -> HistoryCollector

Returns the “default value” for a type. Read more
source§

impl HistoryListener for HistoryCollector

source§

fn log_query_start(&self) -> QueryId

Log that a query has started on query start - right after the call to Session::query.
source§

fn log_query_success(&self, query_id: QueryId)

Log that query was successful - called right before returning the result from Session::query, execute, etc.
source§

fn log_query_error(&self, query_id: QueryId, error: &QueryError)

Log that query ended with an error - called right before returning the error from Session::query, execute, etc.
source§

fn log_new_speculative_fiber(&self, query_id: QueryId) -> SpeculativeId

Log that a new speculative fiber has started.
source§

fn log_attempt_start( &self, query_id: QueryId, speculative_id: Option<SpeculativeId>, node_addr: SocketAddr ) -> AttemptId

Log that an attempt has started - request has been sent on some Connection, now awaiting for an answer.
source§

fn log_attempt_success(&self, attempt_id: AttemptId)

Log that an attempt succeeded.
source§

fn log_attempt_error( &self, attempt_id: AttemptId, error: &QueryError, retry_decision: &RetryDecision )

Log that an attempt ended with an error. The error and decision whether to retry the attempt are also included in the log.

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

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

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

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.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

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

§

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>,

§

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.
source§

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

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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