Skip to content

Commit 0f216b4

Browse files
authored
debugging startup times (#350)
Adds some debug level log messages during startup to make it easier to see what phase of startup is taking a long time. Avoids the value buffer shuffle when non-compressible values have been used.
1 parent 0999d0d commit 0f216b4

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ fn main() {
181181
// begin cli output
182182
control_runtime.spawn(output::log(config.clone()));
183183

184+
debug!("Running workload generator");
184185
// start the workload generator(s)
185186
let workload_runtime = launch_workload(
186187
workload_generator,
@@ -191,6 +192,7 @@ fn main() {
191192
oltp_sender,
192193
);
193194

195+
debug!("Starting clients");
194196
// start client(s)
195197
let client_runtime = clients::cache::launch(&config, client_receiver);
196198

@@ -221,6 +223,7 @@ fn main() {
221223
}
222224
}
223225

226+
debug!("Waiting for test to complete");
224227
while RUNNING.load(Ordering::Relaxed) {
225228
std::thread::sleep(Duration::from_secs(1));
226229
}

src/workload/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,12 @@ impl Keyspace {
794794
let len = 100 * 1024 * 1024;
795795
let mut vbuf = BytesMut::zeroed(len);
796796
rng.fill_bytes(&mut vbuf[0..value_random_bytes]);
797-
vbuf.shuffle(&mut rng);
797+
798+
// if we have compressible values, we need to distribute the remaining
799+
// zeros evenly across the value buffer
800+
if vbuf.len() > value_random_bytes {
801+
vbuf.shuffle(&mut rng);
802+
}
798803

799804
let command_dist = WeightedAliasIndex::new(command_weights).unwrap();
800805

0 commit comments

Comments
 (0)