pub struct Contract {
pub format_version: u32,
pub name: String,
pub rounds: usize,
pub cluster: Cluster,
pub kafka_image: String,
pub cells: Vec<Cell>,
pub budgets: BTreeMap<Metric, Budget>,
pub modes: BTreeMap<Mode, ModePolicy>,
}Expand description
The whole regression contract.
Fields§
§format_version: u32Must be FORMAT_VERSION.
name: StringThe contract’s name, which every record and report carries.
rounds: usizeInterleaved rounds; each round runs every cell once per side.
cluster: ClusterThe cluster every trial runs against.
kafka_image: StringThe pinned Kafka image a Mode::PinnedKafka comparison runs, and
whose client jars drive both sides in every mode.
cells: Vec<Cell>The workload matrix.
budgets: BTreeMap<Metric, Budget>One budget per budgeted metric.
modes: BTreeMap<Mode, ModePolicy>What each mode gates on.
Implementations§
Source§impl Contract
impl Contract
Sourcepub fn from_json(bytes: &[u8]) -> Result<Self, BudgetError>
pub fn from_json(bytes: &[u8]) -> Result<Self, BudgetError>
Parse and validate a contract from its JSON bytes.
§Errors
Returns BudgetError when the bytes are not a contract or the
contract fails Contract::validate.
Sourcepub fn validate(&self) -> Result<(), BudgetError>
pub fn validate(&self) -> Result<(), BudgetError>
Check that the contract can judge a comparison.
§Errors
Returns BudgetError::InvalidContract naming the first problem.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Contract
impl<'de> Deserialize<'de> for Contract
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
impl StructuralPartialEq for Contract
Auto Trait Implementations§
impl Freeze for Contract
impl RefUnwindSafe for Contract
impl Send for Contract
impl Sync for Contract
impl Unpin for Contract
impl UnsafeUnpin for Contract
impl UnwindSafe for Contract
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