From 741f0177c53ae536801a67c8ec194d6be3505d2d Mon Sep 17 00:00:00 2001 From: Evan Klitzke Date: Mon, 5 Mar 2018 14:24:12 -0500 Subject: Add DynamicMemoryUsage() to LevelDB This adds a DynamicMemoryUsage() method similar to the existing methods of the same name, and adds logging of memory usage to CDBWrapper::WriteBatch. --- src/dbwrapper.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/dbwrapper.h') diff --git a/src/dbwrapper.h b/src/dbwrapper.h index a29938ce33..6f80eedc7a 100644 --- a/src/dbwrapper.h +++ b/src/dbwrapper.h @@ -198,6 +198,9 @@ private: //! the database itself leveldb::DB* pdb; + //! the name of this database + std::string m_name; + //! a key used for optional XOR-obfuscation of the database std::vector obfuscate_key; @@ -284,6 +287,9 @@ public: bool WriteBatch(CDBBatch& batch, bool fSync = false); + // Get an estimate of LevelDB memory usage (in bytes). + size_t DynamicMemoryUsage() const; + // not available for LevelDB; provide for compatibility with BDB bool Flush() { -- cgit v1.2.3