pub struct GetPerformanceStats;Expand description
Get Performance Stats operation
Retrieves current performance statistics from the system, with optional detailed metrics including operation breakdowns and timing information.
§Context Requirements
- Context must have an initialized index (for basic stats)
- Performance monitoring may need to be enabled for detailed metrics
§Example
use shardex::api::{ShardexContext, GetPerformanceStatsParams, CreateIndexParams};
use shardex::api::operations::{GetPerformanceStats, CreateIndex};
use apithing::ApiOperation;
let params = GetPerformanceStatsParams::detailed();
let stats = GetPerformanceStats::execute(&mut context, ¶ms)?;
println!("Total operations: {}, Memory: {} MB",
stats.total_operations,
stats.memory_usage / 1024 / 1024);Trait Implementations§
Source§impl ApiOperation<ShardexContext, GetPerformanceStatsParams> for GetPerformanceStats
impl ApiOperation<ShardexContext, GetPerformanceStatsParams> for GetPerformanceStats
Source§type Output = PerformanceStats
type Output = PerformanceStats
The type returned by a successful operation execution.
Source§type Error = ShardexError
type Error = ShardexError
The error type returned when an operation fails.
Source§fn execute(
context: &mut ShardexContext,
parameters: &GetPerformanceStatsParams,
) -> Result<Self::Output, Self::Error>
fn execute( context: &mut ShardexContext, parameters: &GetPerformanceStatsParams, ) -> Result<Self::Output, Self::Error>
Execute the API operation with the given context and properties.
Auto Trait Implementations§
impl Freeze for GetPerformanceStats
impl RefUnwindSafe for GetPerformanceStats
impl Send for GetPerformanceStats
impl Sync for GetPerformanceStats
impl Unpin for GetPerformanceStats
impl UnwindSafe for GetPerformanceStats
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, C, P> Execute<C, P> for Twhere
T: ApiOperation<C, P>,
impl<T, C, P> Execute<C, P> for Twhere
T: ApiOperation<C, P>,
Source§type Output = <T as ApiOperation<C, P>>::Output
type Output = <T as ApiOperation<C, P>>::Output
The type returned by a successful operation execution.
Source§type Error = <T as ApiOperation<C, P>>::Error
type Error = <T as ApiOperation<C, P>>::Error
The error type returned when an operation fails.
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