Skip to content

Commit 48ee32a

Browse files
authored
crutest cleaning; adding rand-read/write tests (#1233)
This is a grab-bag of `crutest` improvements and features, with the goal of making benchmarking and performance evaluation easier. # New features Adding `rand-read` and `rand-write` workloads. This is meant to mimic the `fio` workload, but running outside of the Propolis VM to remove one layer of abstraction. # Medium optimization Refactor `fill_workload` and `verify_volume` to use 8x worker tasks and run in parallel. This is a significant speedup: for a 32 GiB region, running fill + verify goes from 7:47 down to 1:35. # Minor tweaks - Use `&Guest` instead of `Arc<&Guest>` in function arguments where possible - Use `default_value_t` instead of `default_value` so that default arguments are checked at compile-time - Make some functions take `&self` instead of `&mut self` - Delete unused functions (`RegionInfo::set_wc_min`) - Replace `Vec<Future<..>>` with `FuturesOrdered` in a few places, and remove our custom `join_all` function
1 parent 09bcfa6 commit 48ee32a

File tree

7 files changed

+587
-178
lines changed

7 files changed

+587
-178
lines changed

Cargo.lock

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ futures-core = "0.3"
5151
hex = "0.4"
5252
http = "0.2.12"
5353
httptest = "0.15.5"
54+
human_bytes = "0.4.3"
5455
hyper = { version = "0.14", features = [ "full" ] }
5556
hyper-staticfile = "0.9"
5657
indicatif = { version = "0.17.8", features = ["rayon"] }

common/src/lib.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,11 @@ impl std::fmt::Display for BuildInfo {
333333
* A common logger setup for all to use.
334334
*/
335335
pub fn build_logger() -> slog::Logger {
336+
build_logger_with_level(slog::Level::Info)
337+
}
338+
339+
/// Build a logger with the specific log level
340+
pub fn build_logger_with_level(level: slog::Level) -> slog::Logger {
336341
let main_drain = if atty::is(atty::Stream::Stdout) {
337342
let decorator = slog_term::TermDecorator::new().build();
338343
let drain = slog_term::FullFormat::new(decorator).build().fuse();
@@ -350,7 +355,7 @@ pub fn build_logger() -> slog::Logger {
350355

351356
let (dtrace_drain, probe_reg) = slog_dtrace::Dtrace::new();
352357

353-
let filtered_main = slog::LevelFilter::new(main_drain, slog::Level::Info);
358+
let filtered_main = slog::LevelFilter::new(main_drain, level);
354359

355360
let log = slog::Logger::root(
356361
slog::Duplicate::new(filtered_main.fuse(), dtrace_drain.fuse()).fuse(),

crutest/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ crucible.workspace = true
1717
csv.workspace = true
1818
dropshot.workspace = true
1919
dsc-client.workspace = true
20+
human_bytes.workspace = true
2021
futures-core.workspace = true
2122
futures.workspace = true
2223
indicatif.workspace = true
@@ -30,6 +31,7 @@ ringbuffer.workspace = true
3031
schemars.workspace = true
3132
serde.workspace = true
3233
serde_json.workspace = true
34+
slog.workspace = true
3335
signal-hook-tokio.workspace = true
3436
signal-hook.workspace = true
3537
statistical.workspace = true

crutest/src/cli.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ async fn process_cli_command(
887887
match perf_workload(
888888
guest,
889889
ri,
890-
&mut None,
890+
None,
891891
count,
892892
io_size,
893893
io_depth,

0 commit comments

Comments
 (0)