From 4b1eb1d64f732ef305391acc5ce0c253f8ef1919 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Sat, 8 Jun 2019 22:35:31 +0200 Subject: [PATCH] Add self-distribution test --- README.md | 18 +++++++ benchmarks/index.js | 1 + benchmarks/self-distribution.js | 49 ++++++++++++++++++ benchmarks/self-distribution.plot.js | 76 ++++++++++++++++++++++++++++ level-bench.js | 6 ++- lib/result.js | 3 +- package.json | 1 + 7 files changed, 151 insertions(+), 3 deletions(-) create mode 100644 benchmarks/self-distribution.js create mode 100644 benchmarks/self-distribution.plot.js diff --git a/README.md b/README.md index 4f1269c..c3fdfec 100644 --- a/README.md +++ b/README.md @@ -151,6 +151,24 @@ Same as `write`, but in batches rather than singular puts. Perform concurrent `b - `--concurrency`: default 1 - `--valueSize`: size of value, as a number in bytes or string with unit (e.g. `--valueSize 1kb`) +### `self-distribution` + +_Not a benchmark, but a temporary cheat to reuse the tooling we have here to test (and visualize) some of the internals. Needs a valid `target` argument, same as real benchmarks, although that argument is not actually used._ + +Generate keys with a certain order and probability distribution. Options: + +- `-n`: amount of keys to generate, default 5e3 +- Other options are passed to [`keyspace`](https://github.com/vweevers/keyspace) + +Example: + +``` +level-bench run self-distribution memdown -b [--distribution zipfian --skew 1] +level-bench run self-distribution memdown -b [--distribution zipfian --skew=-1] +level-bench run self-distribution memdown -b [--keys seq] +level-bench plot self-distribution +``` +