1
0
Fork 0
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:
EmelyanenkoK 2024-07-26 22:11:58 +03:00 committed by GitHub
parent 679e6be294
commit b3828f8eb2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 83 additions and 3 deletions

View file

@ -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) {