mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Print oldest celldb snapshot to stats (#1078)
Co-authored-by: SpyCheese <mikle98@yandex.ru>
This commit is contained in:
parent
679e6be294
commit
b3828f8eb2
6 changed files with 83 additions and 3 deletions
|
@ -60,9 +60,19 @@ TEST(KeyValue, simple) {
|
|||
ensure_value(as_slice(x), as_slice(x));
|
||||
|
||||
kv.reset();
|
||||
kv = std::make_unique<td::RocksDb>(td::RocksDb::open(db_name.str()).move_as_ok());
|
||||
td::RocksDbOptions options{.snapshot_statistics = std::make_shared<td::RocksDbSnapshotStatistics>()};
|
||||
kv = std::make_unique<td::RocksDb>(td::RocksDb::open(db_name.str(), options).move_as_ok());
|
||||
ensure_value("A", "HELLO");
|
||||
ensure_value(as_slice(x), as_slice(x));
|
||||
|
||||
CHECK(!options.snapshot_statistics->oldest_snapshot_timestamp());
|
||||
auto snapshot = kv->snapshot();
|
||||
CHECK(options.snapshot_statistics->oldest_snapshot_timestamp());
|
||||
auto snapshot2 = kv->snapshot();
|
||||
snapshot.reset();
|
||||
CHECK(options.snapshot_statistics->oldest_snapshot_timestamp());
|
||||
snapshot2.reset();
|
||||
CHECK(!options.snapshot_statistics->oldest_snapshot_timestamp());
|
||||
};
|
||||
|
||||
TEST(KeyValue, async_simple) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue