bencher: add args duration and summarize_last (seconds)

This commit is contained in:
Joakim Frostegård 2024-01-03 17:36:04 +01:00
parent 7863782413
commit 85862f161a
4 changed files with 65 additions and 42 deletions

View file

@ -45,7 +45,11 @@ pub struct RunConfig<C> {
}
impl<C> RunConfig<C> {
pub fn run(self, command: &C) -> Result<RunSuccessResults, RunErrorResults<C>> {
pub fn run(
self,
command: &C,
duration: usize,
) -> Result<RunSuccessResults, RunErrorResults<C>> {
let mut tracker_config_file = NamedTempFile::new().unwrap();
let mut load_test_config_file = NamedTempFile::new().unwrap();
@ -75,7 +79,7 @@ impl<C> RunConfig<C> {
}
};
for _ in 0..59 {
for _ in 0..(duration - 1) {
if let Ok(Some(status)) = tracker.0.try_wait() {
return Err(RunErrorResults::new(self)
.set_tracker_outputs(tracker)