Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2226)

Unified Diff: chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h

Issue 466373004: [SyncFS] Introduce counters in LevelDBWrapper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h
diff --git a/chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h b/chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h
index 113e718f9583d413ce35baecbc7e46a2f5bb65cb..74340de6e1743052416a480e174781e59e1e809a 100644
--- a/chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h
+++ b/chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.h
@@ -89,6 +89,12 @@ class LevelDBWrapper {
// Clears pending transactions.
void Clear();
+ // Return the number of pending PUT/DELETE operations.
nhiroki 2014/08/14 08:59:30 nit: s/Return/Returns/
peria 2014/08/14 09:01:53 Done.
+ // Each counter counts operations independently, so operations on a key
+ // may be counted more than once.
+ int64 num_puts() { return num_puts_; }
+ int64 num_deletes() { return num_deletes_; }
+
// TODO(peria): Rename this method to GetLevelDBForTesting, after removing
// usages of drive_backend::MigrateDatabaseFromVxToVy() under
// drive_backend_v1/.
@@ -98,6 +104,8 @@ class LevelDBWrapper {
scoped_ptr<leveldb::DB> db_;
PendingOperationMap pending_;
+ int64 num_puts_;
+ int64 num_deletes_;
DISALLOW_COPY_AND_ASSIGN(LevelDBWrapper);
};

Powered by Google App Engine
This is Rietveld 408576698