-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Type Incompatibilities between Actors
I had the type signatures incorrect for the actors. Some took Observation, other T, and the incompatibility is that an Observation is a Group + T, so DecisionEngines were actually able to be constructed. This commit fixes the issue and adds a small smoke test to construct a fake DecisionEngine as proof.
- Loading branch information
1 parent
add9672
commit 2a19dc0
Showing
8 changed files
with
59 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/// The [Group] indicates from whence a given observation | ||
/// was generated: either by a control group deployment or by | ||
/// a canary deployment. | ||
#[derive(Hash, Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] | ||
pub enum Group { | ||
/// The control group is the current running deployment. | ||
Control, | ||
/// The experimental group represents the canary deployment. | ||
Experimental, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use super::{group::Group, EnumerableCategory}; | ||
|
||
/// An [Observation] represents a measured outcome that | ||
/// belongs to either a control group or an experimental | ||
/// group (i.e. canary). | ||
/// The measured outcome must be categorical (for now). | ||
pub struct Observation<Cat: EnumerableCategory> { | ||
/// The experimental group or the control group. | ||
pub group: Group, | ||
/// The outcome of the observation, bucketed into a specific category. | ||
/// e.g. a response status code's highest order digit, 2XX, 5XX, etc. | ||
pub outcome: Cat, | ||
} |