Browse Source

接上一个commit

pull/2/head
cyq 8 months ago
parent
commit
e2ddb615d2
1 changed files with 20 additions and 0 deletions
  1. +20
    -0
      benchmarks/db_bench_FieldDB.cc

+ 20
- 0
benchmarks/db_bench_FieldDB.cc View File

@ -79,6 +79,8 @@ static const char* FLAGS_benchmarks =
"ReadSeqWhileDeleting,"
"ReadRandomWhileCreating,"
"ReadRandomWhileDeleting,"
"WriteRandomWithIndex,"
"WriteSeqWithIndex,"
"snappycomp,"
"snappyuncomp,"
"zstdcomp,"
@ -683,6 +685,12 @@ class Benchmark {
} else if (name == Slice("ReadRandomWhileDeleting")) {
num_threads++;
method = &Benchmark::ReadRandomWhileDeleting;
} else if (name == Slice("WriteRandomWithIndex")) {
fresh_db = true;
method = &Benchmark::WriteRandomWithIndex;
} else if (name == Slice("WriteSeqWithIndex")) {
fresh_db = true;
method = &Benchmark::WriteSeqWithIndex;
} else if (name == Slice("snappycomp")) {
method = &Benchmark::SnappyCompress;
} else if (name == Slice("snappyuncomp")) {
@ -1146,6 +1154,18 @@ class Benchmark {
db_->DeleteIndex("age", write_options_);
}
void WriteSeqWithIndex(ThreadState* thread) {
CreateIndex(thread);
thread->stats.Start();
WriteSeq(thread);
}
void WriteRandomWithIndex(ThreadState* thread) {
CreateIndex(thread);
thread->stats.Start();
WriteRandom(thread);
}
void WriteSeqWhileCreating(ThreadState* thread) {
if (thread->tid > 0) {
WriteSeq(thread);

Loading…
Cancel
Save