pub struct MaelstromDeployment {
pub node_count: usize,
pub maelstrom_path: PathBuf,
pub workload: String,
pub time_limit: Option<u64>,
pub rate: Option<u64>,
pub availability: Option<String>,
pub nemesis: Option<String>,
pub extra_args: Vec<String>,
/* private fields */
}maelstrom only.Expand description
The Maelstrom deployment environment.
This holds configuration for the Maelstrom run and accumulates compilation artifacts during deployment.
Fields§
§node_count: usizeNumber of nodes in the cluster.
maelstrom_path: PathBufPath to the maelstrom binary.
workload: StringWorkload to run (e.g., “echo”, “broadcast”, “g-counter”).
time_limit: Option<u64>Time limit in seconds.
rate: Option<u64>Rate of requests per second.
availability: Option<String>The availability of nodes.
nemesis: Option<String>Nemesis to run during tests.
extra_args: Vec<String>Additional maelstrom arguments.
Implementations§
Source§impl MaelstromDeployment
impl MaelstromDeployment
Sourcepub fn new(workload: impl Into<String>) -> Self
Available on crate feature deploy only.
pub fn new(workload: impl Into<String>) -> Self
deploy only.Create a new Maelstrom deployment with the given node count.
Sourcepub fn node_count(self, count: usize) -> Self
Available on crate feature deploy only.
pub fn node_count(self, count: usize) -> Self
deploy only.Set the node count.
Sourcepub fn maelstrom_path(self, path: impl Into<PathBuf>) -> Self
Available on crate feature deploy only.
pub fn maelstrom_path(self, path: impl Into<PathBuf>) -> Self
deploy only.Set the path to the maelstrom binary.
Sourcepub fn time_limit(self, seconds: u64) -> Self
Available on crate feature deploy only.
pub fn time_limit(self, seconds: u64) -> Self
deploy only.Set the time limit in seconds.
Sourcepub fn rate(self, rate: u64) -> Self
Available on crate feature deploy only.
pub fn rate(self, rate: u64) -> Self
deploy only.Set the request rate per second.
Sourcepub fn availability(self, availability: impl Into<String>) -> Self
Available on crate feature deploy only.
pub fn availability(self, availability: impl Into<String>) -> Self
deploy only.Set the availability for the test.
Sourcepub fn nemesis(self, nemesis: impl Into<String>) -> Self
Available on crate feature deploy only.
pub fn nemesis(self, nemesis: impl Into<String>) -> Self
deploy only.Set the nemesis for the test.
Sourcepub fn extra_args(
self,
args: impl IntoIterator<Item = impl Into<String>>,
) -> Self
Available on crate feature deploy only.
pub fn extra_args( self, args: impl IntoIterator<Item = impl Into<String>>, ) -> Self
deploy only.Add extra arguments to pass to maelstrom.
Sourcepub fn build(&self) -> Result<PathBuf, Error>
Available on crate feature deploy only.
pub fn build(&self) -> Result<PathBuf, Error>
deploy only.Build the compiled binary in dev mode. Returns the path to the compiled binary.
Sourcepub fn run(self) -> Result<(), Error>
Available on crate feature deploy only.
pub fn run(self) -> Result<(), Error>
deploy only.Run Maelstrom with the compiled binary, return Ok(()) if all checks pass.
This will block until Maelstrom completes.
Sourcepub fn binary_path(&self) -> Option<PathBuf>
Available on crate feature deploy only.
pub fn binary_path(&self) -> Option<PathBuf>
deploy only.Get the path to the compiled binary (after building).
Auto Trait Implementations§
impl Freeze for MaelstromDeployment
impl RefUnwindSafe for MaelstromDeployment
impl Send for MaelstromDeployment
impl Sync for MaelstromDeployment
impl Unpin for MaelstromDeployment
impl UnwindSafe for MaelstromDeployment
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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