Skip to content

Commit

Permalink
feat: support no disk (mem only) for foyer bench (#773)
Browse files Browse the repository at this point in the history
Signed-off-by: MrCroxx <mrcroxx@outlook.com>
  • Loading branch information
MrCroxx authored Oct 11, 2024
1 parent 0244d59 commit 50de58c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions foyer-bench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,23 @@ static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;

#[derive(Parser, Debug, Clone)]
#[command(author, version, about)]
#[command(group = ArgGroup::new("exclusive").required(true).args(&["file", "dir"]))]
#[command(group = ArgGroup::new("exclusive").required(true).args(&["file", "dir", "no_disk"]))]
pub struct Args {
/// Run with in-memory cache compatible mode.
///
/// One of `no_disk`, `file`, `dir` must be set.
#[arg(long)]
no_disk: bool,

/// File for disk cache data. Use `DirectFile` as device.
///
/// Either `file` or `dir` must be set.
/// One of `no_disk`, `file`, `dir` must be set.
#[arg(short, long)]
file: Option<String>,

/// Directory for disk cache data. Use `DirectFs` as device.
///
/// Either `file` or `dir` must be set.
/// One of `no_disk`, `file`, `dir` must be set.
#[arg(short, long)]
dir: Option<String>,

Expand Down Expand Up @@ -472,6 +478,7 @@ async fn benchmark(args: Args) {
.with_capacity(args.disk.as_u64() as _)
.with_file_size(args.region_size.as_u64() as _),
),
(None, None) => builder,
_ => unreachable!(),
};

Expand Down

0 comments on commit 50de58c

Please sign in to comment.