pub struct PerformanceBenchmark { /* private fields */ }Expand description
Performance benchmark runner
Implementations§
Source§impl PerformanceBenchmark
impl PerformanceBenchmark
Sourcepub fn new(config: BenchmarkConfig) -> Self
pub fn new(config: BenchmarkConfig) -> Self
Create a new performance benchmark
Sourcepub async fn bench_connection_establishment(
&self,
num_connections: usize,
) -> Result<BenchmarkResult, BenchmarkError>
pub async fn bench_connection_establishment( &self, num_connections: usize, ) -> Result<BenchmarkResult, BenchmarkError>
Benchmark connection establishment
Sourcepub async fn bench_dht_query(
&self,
num_queries: usize,
) -> Result<BenchmarkResult, BenchmarkError>
pub async fn bench_dht_query( &self, num_queries: usize, ) -> Result<BenchmarkResult, BenchmarkError>
Benchmark DHT query performance
Sourcepub async fn bench_throughput(
&self,
num_messages: usize,
message_size: usize,
) -> Result<BenchmarkResult, BenchmarkError>
pub async fn bench_throughput( &self, num_messages: usize, message_size: usize, ) -> Result<BenchmarkResult, BenchmarkError>
Benchmark message throughput
Sourcepub async fn bench_custom<F, Fut>(
&self,
bench_type: BenchmarkType,
operation: F,
) -> Result<BenchmarkResult, BenchmarkError>
pub async fn bench_custom<F, Fut>( &self, bench_type: BenchmarkType, operation: F, ) -> Result<BenchmarkResult, BenchmarkError>
Run a custom benchmark
Sourcepub fn results(&self) -> HashMap<BenchmarkType, Vec<BenchmarkResult>>
pub fn results(&self) -> HashMap<BenchmarkType, Vec<BenchmarkResult>>
Get all benchmark results
Sourcepub fn results_for(
&self,
benchmark_type: BenchmarkType,
) -> Option<Vec<BenchmarkResult>>
pub fn results_for( &self, benchmark_type: BenchmarkType, ) -> Option<Vec<BenchmarkResult>>
Get results for a specific benchmark type
Sourcepub fn clear_results(&self)
pub fn clear_results(&self)
Clear all results
Sourcepub fn summary_report(&self) -> String
pub fn summary_report(&self) -> String
Generate a summary report
Auto Trait Implementations§
impl Freeze for PerformanceBenchmark
impl !RefUnwindSafe for PerformanceBenchmark
impl Send for PerformanceBenchmark
impl Sync for PerformanceBenchmark
impl Unpin for PerformanceBenchmark
impl !UnwindSafe for PerformanceBenchmark
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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