pub struct SloCriteria {
pub name: Option<String>,
pub window: Option<SloWindow>,
pub minimum_sample_count: Option<u64>,
pub upstream_hosts: Option<Vec<String>>,
pub objectives: Vec<SloObjective>,
}Expand description
A named set of service-level objectives over a time window. Maps to the
SloCriteria schema (the body of PUT /mockserver/verifySLO).
Fields§
§name: Option<String>Human-readable criteria name, echoed back in the verdict.
window: Option<SloWindow>The time window to evaluate over.
minimum_sample_count: Option<u64>Minimum samples required in the window; below this the verdict is INCONCLUSIVE.
upstream_hosts: Option<Vec<String>>Optional list of upstream hosts to restrict the evaluation to.
objectives: Vec<SloObjective>The objectives (the verdict is the logical AND of all of them).
Implementations§
Source§impl SloCriteria
impl SloCriteria
Sourcepub fn new(objectives: Vec<SloObjective>) -> Self
pub fn new(objectives: Vec<SloObjective>) -> Self
Create criteria from a set of objectives.
Sourcepub fn minimum_sample_count(self, count: u64) -> Self
pub fn minimum_sample_count(self, count: u64) -> Self
Set the minimum sample count.
Sourcepub fn upstream_hosts(self, hosts: Vec<String>) -> Self
pub fn upstream_hosts(self, hosts: Vec<String>) -> Self
Restrict the evaluation to the given upstream hosts.
Trait Implementations§
Source§impl Clone for SloCriteria
impl Clone for SloCriteria
Source§fn clone(&self) -> SloCriteria
fn clone(&self) -> SloCriteria
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SloCriteria
impl Debug for SloCriteria
Source§impl<'de> Deserialize<'de> for SloCriteria
impl<'de> Deserialize<'de> for SloCriteria
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SloCriteria
impl PartialEq for SloCriteria
Source§fn eq(&self, other: &SloCriteria) -> bool
fn eq(&self, other: &SloCriteria) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for SloCriteria
impl Serialize for SloCriteria
impl StructuralPartialEq for SloCriteria
Auto Trait Implementations§
impl Freeze for SloCriteria
impl RefUnwindSafe for SloCriteria
impl Send for SloCriteria
impl Sync for SloCriteria
impl Unpin for SloCriteria
impl UnsafeUnpin for SloCriteria
impl UnwindSafe for SloCriteria
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