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

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: Work for nits 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
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..7b6c51e11f6c29b74fc62d31f530c2791d28ca2d 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();
+ // Returns the number of pending PUT/DELETE operations.
+ // 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);
};
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/leveldb_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698