From 69e2bd224b7f11e021527cb95bab18f1ee6e1b3b Mon Sep 17 00:00:00 2001 From: costan Date: Tue, 23 May 2017 17:29:44 -0700 Subject: LevelDB: Add WriteBatch::ApproximateSize(). This can be used to report metrics on LevelDB usage. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=156934930 --- include/leveldb/write_batch.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/leveldb/write_batch.h b/include/leveldb/write_batch.h index ee9aab6..65a76d8 100644 --- a/include/leveldb/write_batch.h +++ b/include/leveldb/write_batch.h @@ -42,6 +42,12 @@ class WriteBatch { // Clear all updates buffered in this batch. void Clear(); + // The size of the database changes caused by this batch. + // + // This number is tied to implementation details, and may change across + // releases. It is intended for LevelDB usage metrics. + size_t ApproximateSize(); + // Support for iterating over the contents of a batch. class Handler { public: -- cgit v1.2.1