瀏覽代碼

查出了性能测试destroy错误的问题

pull/2/head
augurier 8 月之前
父節點
當前提交
b3de788556
共有 3 個檔案被更改,包括 7 行新增7 行删除
  1. +2
    -3
      benchmarks/db_bench_FieldDB.cc
  2. +2
    -2
      benchmarks/db_bench_testDB.cc
  3. +3
    -2
      testdb/testdb.cc

+ 2
- 3
benchmarks/db_bench_FieldDB.cc 查看文件

@ -547,7 +547,7 @@ class Benchmark {
}
}
if (!FLAGS_use_existing_db) {
DestroyDB(FLAGS_db, Options());
fielddb::DestroyDB(FLAGS_db, Options());
}
}
@ -676,7 +676,7 @@ class Benchmark {
} else {
delete db_;
db_ = nullptr;
DestroyDB(FLAGS_db, Options());
fielddb::DestroyDB(FLAGS_db, Options());
Open();
}
}
@ -833,7 +833,6 @@ class Benchmark {
options.compression =
FLAGS_compression ? kSnappyCompression : kNoCompression;
// Status s = DB::Open(options, FLAGS_db, &db_);
//fielddb::DestroyDB(FLAGS_db, options);
db_ = new FieldDB();
Status s = FieldDB::OpenFieldDB(options, FLAGS_db, &db_);
if (!s.ok()) {

+ 2
- 2
benchmarks/db_bench_testDB.cc 查看文件

@ -544,7 +544,7 @@ class Benchmark {
}
}
if (!FLAGS_use_existing_db) {
DestroyDB(FLAGS_db, Options());
testdb::DestroyDB(FLAGS_db, Options());
}
}
@ -665,7 +665,7 @@ class Benchmark {
} else {
delete db_;
db_ = nullptr;
DestroyDB(FLAGS_db, Options());
testdb::DestroyDB(FLAGS_db, Options());
Open();
}
}

+ 3
- 2
testdb/testdb.cc 查看文件

@ -2,6 +2,7 @@
#include "db/db_impl.h"
#include <memory>
#include "leveldb/status.h"
#include "testdb.h"
using namespace testdb;
Status testDB::OpentestDB(Options& options,
@ -93,7 +94,7 @@ void testDB::CompactRange(const Slice *begin, const Slice *end) {
kvDB_->CompactRange(begin, end);
}
Status DestroyDB(const std::string& name, const Options& options) {
Status testdb::DestroyDB(const std::string& name, const Options& options) {
Status s;
s = leveldb::DestroyDB(name+"_kvDB", options);
assert(s.ok());
@ -108,4 +109,4 @@ testDB::~testDB() {
delete kvDB_;
// delete indexDB_;
// delete metaDB_;
}
}

Loading…
取消
儲存