diff --git a/examples/mixed/README.md b/examples/mixed/README.md new file mode 100644 index 0000000..3c5a9a2 --- /dev/null +++ b/examples/mixed/README.md @@ -0,0 +1,73 @@ +This example shows a benchmark that consists of multiple phases (5 seconds +running time each), benchmarked with 32 threads. + +The workload file, `mixed.toml` is as follows: + +```toml +[global] +threads = 1 +repeat = 5 +klen = 8 +vlen = 16 +kmin = 0 +kmax = 1000000 +report = "repeat" + +[[benchmark]] +set_perc = 100 +get_perc = 0 +del_perc = 0 +repeat = 1 +dist = "incrementp" +report = "hidden" + +# write-intensive, zipfian +[[benchmark]] +set_perc = 50 +get_perc = 50 +del_perc = 0 +timeout = 1.0 +dist = "zipfian" + +# write-intensive, zipfian, hotspot in middle +[[benchmark]] +set_perc = 50 +get_perc = 50 +del_perc = 0 +timeout = 1.0 +dist = "zipfian" +zipf_hotspot = 0.5 + +# read-intensive, zipfian +[[benchmark]] +set_perc = 5 +get_perc = 95 +del_perc = 0 +timeout = 1.0 +dist = "zipfian" + +# read-only, uniform +[[benchmark]] +set_perc = 0 +get_perc = 100 +del_perc = 0 +timeout = 1.0 +dist = "uniform" +``` + +In the first phase, all worker threads fill the key space of the store, and the metrics are hidden. +Then, the benchmark consists of 4 parts with 5 seconds running time each: + +- Write-intensive on popular keys. +- Write-intensive on popular keys while the popular keys shifted to the middle of the +key space. +- Read-intensive (only 5% writes) on popular keys. +- Read-only on uniformly random keys. + +The script file `run.sh` runs this benchmark against multiple stores with 32 threads. +Although the number of threads set in the configuration file is only 1, the number of threads are +dynamically adjusted by setting `global.threads` to 32. + +Results: + +[mixed](mixed.pdf) diff --git a/examples/readpopular/README.md b/examples/readpopular/README.md new file mode 100644 index 0000000..9c66eaf --- /dev/null +++ b/examples/readpopular/README.md @@ -0,0 +1,42 @@ +This example shows a benchmark that reads popular records in the store, running with different +number of threads. + +The workload file, `readpopular.toml` is as follows: + +```toml +[global] +threads = 1 +repeat = 1 +klen = 8 +vlen = 16 +kmin = 0 +kmax = 1000000 + +[[benchmark]] +set_perc = 100 +get_perc = 0 +del_perc = 0 +repeat = 1 +dist = "incrementp" +report = "hidden" + +[[benchmark]] +timeout = 1 +set_perc = 0 +get_perc = 100 +del_perc = 0 +dist = "zipfian" +zipf_theta = 1.0 +report = "finish" +``` + +In the first phase, all worker threads fill the key space of the store, and the metrics are hidden. +In the second phase, worker threads execute the read-only workload that accesses Zipfian keys for +1 second and report once when finished. + +The script file `run.sh` runs this benchmark against multiple stores with different number of +threads. The number of threads are dynamically adjusted via `global.threads` environment variable. + +Results: + +[readpopular](readpopular.pdf) diff --git a/examples/writeheavy/README.md b/examples/writeheavy/README.md new file mode 100644 index 0000000..d785768 --- /dev/null +++ b/examples/writeheavy/README.md @@ -0,0 +1,41 @@ +This example shows a benchmark that mixes reads and writes at 1:1 ratio accessing a random record +in the store, running with different number of threads. + +The workload file, `writeheavy.toml` is as follows: + +```toml +[global] +threads = 1 +repeat = 1 +klen = 8 +vlen = 16 +kmin = 0 +kmax = 1000000 + +[[benchmark]] +set_perc = 100 +get_perc = 0 +del_perc = 0 +repeat = 1 +dist = "incrementp" +report = "hidden" + +[[benchmark]] +timeout = 1 +set_perc = 50 +get_perc = 50 +del_perc = 0 +dist = "uniform" +report = "finish" +``` + +In the first phase, all worker threads fill the key space of the store, and the metrics are hidden. +In the second phase, worker threads execute the write-heavy workload for 1 second and report once +when finished. + +The script file `run.sh` runs this benchmark against multiple stores with different number of +threads. The number of threads are dynamically adjusted via `global.threads` environment variable. + +Results: + +[writeheavy](writeheavy.pdf) diff --git a/examples/your-kv-store/README.md b/examples/your-kv-store/README.md index f409e77..7e99dd8 100644 --- a/examples/your-kv-store/README.md +++ b/examples/your-kv-store/README.md @@ -1,3 +1,5 @@ +This example shows how to integrate `kvbench` into your own key-value store implementations. + To compile, simply use: ``` diff --git a/examples/your-kv-store/src/main.rs b/examples/your-kv-store/src/main.rs index b9a4b1b..40cc660 100644 --- a/examples/your-kv-store/src/main.rs +++ b/examples/your-kv-store/src/main.rs @@ -5,7 +5,7 @@ extern crate kvbench; use kvbench::inventory; use kvbench::toml; -use kvbench::bench::{BenchKVMap, Registry}; +use kvbench::stores::{BenchKVMap, Registry}; use kvbench::{KVMap, KVMapHandle}; use std::collections::HashMap; use std::sync::{Arc, RwLock};