MCPcopy Create free account
hub / github.com/ElementsProject/elements / Benchmark

Method Benchmark

src/leveldb/benchmarks/db_bench_tree_db.cc:288–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286 enum DBState { FRESH, EXISTING };
287
288 Benchmark()
289 : db_(nullptr),
290 num_(FLAGS_num),
291 reads_(FLAGS_reads < 0 ? FLAGS_num : FLAGS_reads),
292 bytes_(0),
293 rand_(301) {
294 std::vector<std::string> files;
295 std::string test_dir;
296 Env::Default()->GetTestDirectory(&test_dir);
297 Env::Default()->GetChildren(test_dir.c_str(), &files);
298 if (!FLAGS_use_existing_db) {
299 for (int i = 0; i < files.size(); i++) {
300 if (Slice(files[i]).starts_with("dbbench_polyDB")) {
301 std::string file_name(test_dir);
302 file_name += "/";
303 file_name += files[i];
304 Env::Default()->DeleteFile(file_name.c_str());
305 }
306 }
307 }
308 }
309
310 ~Benchmark() {
311 if (!db_->close()) {

Callers

nothing calls this directly

Calls 5

SliceClass · 0.50
GetTestDirectoryMethod · 0.45
GetChildrenMethod · 0.45
sizeMethod · 0.45
DeleteFileMethod · 0.45

Tested by

no test coverage detected