pub struct QueryProfiler { /* private fields */ }Expand description
Main query profiler
Implementations§
Source§impl QueryProfiler
impl QueryProfiler
Sourcepub fn new(config: ProfilerConfig) -> Self
pub fn new(config: ProfilerConfig) -> Self
Create a new query profiler with the given configuration
Sourcepub fn start_session(&self, query_text: &str) -> QueryProfilingSession
pub fn start_session(&self, query_text: &str) -> QueryProfilingSession
Start a new profiling session for a query
Sourcepub fn record_query(
&self,
query_text: String,
statistics: QueryStatistics,
query_type: String,
)
pub fn record_query( &self, query_text: String, statistics: QueryStatistics, query_type: String, )
Record a completed query
Sourcepub fn get_statistics(&self) -> ProfilingStatistics
pub fn get_statistics(&self) -> ProfilingStatistics
Get aggregated profiling statistics
Sourcepub fn get_slow_queries(&self, limit: usize) -> Vec<ProfiledQuery>
pub fn get_slow_queries(&self, limit: usize) -> Vec<ProfiledQuery>
Get recent slow queries
Sourcepub fn clear_history(&self)
pub fn clear_history(&self)
Clear profiling history
Sourcepub fn export_json(&self) -> Result<String, OxirsError>
pub fn export_json(&self) -> Result<String, OxirsError>
Export profiling data as JSON
Auto Trait Implementations§
impl Freeze for QueryProfiler
impl !RefUnwindSafe for QueryProfiler
impl Send for QueryProfiler
impl Sync for QueryProfiler
impl Unpin for QueryProfiler
impl UnsafeUnpin for QueryProfiler
impl !UnwindSafe for QueryProfiler
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