pub struct ABTestManager { /* private fields */ }Expand description
Main A/B testing manager
Implementations§
Source§impl ABTestManager
impl ABTestManager
Sourcepub fn create_experiment(&self, config: ExperimentConfig) -> Result<String>
pub fn create_experiment(&self, config: ExperimentConfig) -> Result<String>
Create a new experiment
Sourcepub fn route_request(
&self,
experiment_id: &str,
user_id: &str,
) -> Result<Variant>
pub fn route_request( &self, experiment_id: &str, user_id: &str, ) -> Result<Variant>
Route a request to appropriate variant
Sourcepub fn record_metric(
&self,
experiment_id: &str,
variant: &Variant,
metric_type: MetricType,
value: MetricValue,
) -> Result<()>
pub fn record_metric( &self, experiment_id: &str, variant: &Variant, metric_type: MetricType, value: MetricValue, ) -> Result<()>
Record a metric for an experiment
Sourcepub fn analyze_experiment(&self, experiment_id: &str) -> Result<TestResult>
pub fn analyze_experiment(&self, experiment_id: &str) -> Result<TestResult>
Analyze experiment results
Sourcepub fn get_experiment_status(
&self,
experiment_id: &str,
) -> Result<ExperimentStatus>
pub fn get_experiment_status( &self, experiment_id: &str, ) -> Result<ExperimentStatus>
Get experiment status
Sourcepub fn start_experiment(&self, experiment_id: &str) -> Result<()>
pub fn start_experiment(&self, experiment_id: &str) -> Result<()>
Start an experiment
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ABTestManager
impl !RefUnwindSafe for ABTestManager
impl Send for ABTestManager
impl Sync for ABTestManager
impl Unpin for ABTestManager
impl UnsafeUnpin for ABTestManager
impl !UnwindSafe for ABTestManager
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