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
impl HistoryCollector
sourcepub fn new() -> HistoryCollector
pub fn new() -> HistoryCollector
Creates a new HistoryCollector with empty data.
sourcepub fn clone_collected(&self) -> HistoryCollectorData
pub fn clone_collected(&self) -> HistoryCollectorData
Clones the data collected by the collector.
sourcepub fn take_collected(&self) -> HistoryCollectorData
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.
sourcepub fn clone_structured_history(&self) -> StructuredHistory
pub fn clone_structured_history(&self) -> StructuredHistory
Clone the collected events and convert them to StructuredHistory.
sourcepub fn take_structured_history(&self) -> StructuredHistory
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
impl Debug for HistoryCollector
source§impl Default for HistoryCollector
impl Default for HistoryCollector
source§fn default() -> HistoryCollector
fn default() -> HistoryCollector
Returns the “default value” for a type. Read more
source§impl HistoryListener for HistoryCollector
impl HistoryListener for HistoryCollector
source§fn log_query_start(&self) -> QueryId
fn log_query_start(&self) -> QueryId
Log that a query has started on query start - right after the call to Session::{query,execute}_*/batch.
source§fn log_query_success(&self, query_id: QueryId)
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)
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
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
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)
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,
)
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§
impl !Freeze for HistoryCollector
impl RefUnwindSafe for HistoryCollector
impl Send for HistoryCollector
impl Sync for HistoryCollector
impl Unpin for HistoryCollector
impl UnwindSafe for HistoryCollector
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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