pub struct Budget {
pub prefix: String,
pub cache: CacheMode,
pub metric: String,
pub microseconds: f64,
pub minimum_samples: usize,
}Expand description
An absolute bound on one metric of every target whose key starts with a prefix.
use majordomus_cli::bench::baseline::Budget;
use majordomus_cli::bench::results::CacheMode;
// "a warm screen of the UI answers within 100 ms at p95", as the policy file states it
let budget = Budget {
prefix: "system.http.live.ui.".into(),
cache: CacheMode::Warm,
metric: "p95".into(),
microseconds: 100_000.0,
minimum_samples: 20,
};
assert!("system.http.live.ui.roadmap".starts_with(&budget.prefix));
assert!(!"system.http.cockpit_overview".starts_with(&budget.prefix));Fields§
§prefix: StringThe targets it bounds: every key that starts with this (system.http.live.ui.).
cache: CacheModeThe cache mode it bounds; a measurement in another mode is not judged by it.
metric: StringThe metric (p50, p95, p99, …).
microseconds: f64The bound, in microseconds.
minimum_samples: usizeThe bound holds only when the run took at least this many samples; under it the
line is reported as SHORT and does not fail.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Budget
impl<'de> Deserialize<'de> for Budget
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 JsonSchema for Budget
impl JsonSchema for Budget
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Budget
Auto Trait Implementations§
impl Freeze for Budget
impl RefUnwindSafe for Budget
impl Send for Budget
impl Sync for Budget
impl Unpin for Budget
impl UnsafeUnpin for Budget
impl UnwindSafe for Budget
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