2 Commits

2 changed files with 4 additions and 4 deletions
Split View
  1. +1
    -1
      db/slotpage.h
  2. +3
    -3
      test/db_test_latent.cc

+ 1
- 1
db/slotpage.h View File

@ -194,7 +194,7 @@ public:
}
BitMap(const std::string &dbname) {
name = "./" + dbname + "/" + dbname + "_bitmap";
name = dbname + "_bitmap";
config_file_name = name + "_config_file";
auto bitmap_handler = std::fstream(name, std::ios::in | std::ios::out);

+ 3
- 3
test/db_test_latent.cc View File

@ -93,7 +93,7 @@ void TestLatency(leveldb::DB* db, int num_operations, std::vector& lat_
// 输出延迟统计信息(可选)
double avg_latency = std::accumulate(lat_res.begin(), lat_res.end(), 0.0) / lat_res.size();
std::cout << "Average Latency: " << std::fixed << std::setprecision(2) << avg_latency << " ms" << std::endl;
std::cout << "Average Latency: " << std::fixed << std::setprecision(6) << avg_latency << " ms" << std::endl;
std::cout << "Max Latency: " << *std::max_element(lat_res.begin(), lat_res.end()) << " ms" << std::endl;
std::cout << "Min Latency: " << *std::min_element(lat_res.begin(), lat_res.end()) << " ms" << std::endl;
}
@ -107,11 +107,11 @@ TEST(TestSchema, Basic) {
abort();
}
// 吞吐量测试
TestThroughput(db, 1000);
TestThroughput(db, 100000);
// 延迟测试
std::vector<int64_t> latency_results;
TestLatency(db, 1000, latency_results);
TestLatency(db, 100000, latency_results);
// 关闭数据库
delete db;
}

Loading…
Cancel
Save