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

Method Benchmark

src/leveldb/benchmarks/db_bench_sqlite3.cc:311–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309 enum DBState { FRESH, EXISTING };
310
311 Benchmark()
312 : db_(nullptr),
313 db_num_(0),
314 num_(FLAGS_num),
315 reads_(FLAGS_reads < 0 ? FLAGS_num : FLAGS_reads),
316 bytes_(0),
317 rand_(301) {
318 std::vector<std::string> files;
319 std::string test_dir;
320 Env::Default()->GetTestDirectory(&test_dir);
321 Env::Default()->GetChildren(test_dir, &files);
322 if (!FLAGS_use_existing_db) {
323 for (int i = 0; i < files.size(); i++) {
324 if (Slice(files[i]).starts_with("dbbench_sqlite3")) {
325 std::string file_name(test_dir);
326 file_name += "/";
327 file_name += files[i];
328 Env::Default()->DeleteFile(file_name.c_str());
329 }
330 }
331 }
332 }
333
334 ~Benchmark() {
335 int status = sqlite3_close(db_);

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