pub struct PluginPerformanceTester {
pub test_configs: Vec<PluginConfig>,
pub max_duration: Duration,
pub memory_baseline: usize,
}Expand description
Performance testing utilities for plugins
PluginPerformanceTester provides tools for measuring plugin performance, memory usage, and identifying bottlenecks in plugin implementations.
§Examples
ⓘ
use sklears_core::plugin::{PluginPerformanceTester, MockPlugin};
let mut tester = PluginPerformanceTester::new();
let mut plugin = MockPlugin::new("test_plugin");
let result = tester.benchmark_initialization(&mut plugin);
println!("Initialization took: {:?}", result.duration);Fields§
§test_configs: Vec<PluginConfig>Test configurations for benchmarking
max_duration: DurationMaximum allowed duration for operations
memory_baseline: usizeMemory usage baseline
Implementations§
Source§impl PluginPerformanceTester
impl PluginPerformanceTester
Sourcepub fn with_timeout(max_duration: Duration) -> Self
pub fn with_timeout(max_duration: Duration) -> Self
Create performance tester with custom timeout
§Arguments
max_duration- Maximum allowed duration for operations
Sourcepub fn benchmark_initialization(
&mut self,
plugin: &mut dyn Plugin,
) -> PerformanceResult
pub fn benchmark_initialization( &mut self, plugin: &mut dyn Plugin, ) -> PerformanceResult
Sourcepub fn benchmark_validation(
&self,
plugin: &dyn Plugin,
config: &PluginConfig,
) -> PerformanceResult
pub fn benchmark_validation( &self, plugin: &dyn Plugin, config: &PluginConfig, ) -> PerformanceResult
Sourcepub fn run_performance_suite(
&mut self,
plugin: &mut dyn Plugin,
) -> Vec<PerformanceResult>
pub fn run_performance_suite( &mut self, plugin: &mut dyn Plugin, ) -> Vec<PerformanceResult>
Trait Implementations§
Source§impl Debug for PluginPerformanceTester
impl Debug for PluginPerformanceTester
Auto Trait Implementations§
impl Freeze for PluginPerformanceTester
impl RefUnwindSafe for PluginPerformanceTester
impl Send for PluginPerformanceTester
impl Sync for PluginPerformanceTester
impl Unpin for PluginPerformanceTester
impl UnwindSafe for PluginPerformanceTester
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> 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