From 942687d2202349391d90730956df4b084c9eeb58 Mon Sep 17 00:00:00 2001 From: "rlarocque@chromium.org" Date: Mon, 4 Jun 2012 18:54:41 +0000 Subject: Add chrome://sync counter for total commits This is a strictly increasing counter that tracks the total number of successful commits during the life of this sync instance. BUG=128409 TEST=Open chrome://sync, observe "Successful Commits" counter. Review URL: https://chromiumcodereview.appspot.com/10441117 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140338 0039d316-1c4b-4281-b951-d872f2087c98 --- sync/internal_api/all_status.cc | 2 ++ sync/internal_api/sync_manager.cc | 1 + sync/internal_api/sync_manager.h | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'sync') diff --git a/sync/internal_api/all_status.cc b/sync/internal_api/all_status.cc index 17c885d..194f26b 100644 --- a/sync/internal_api/all_status.cc +++ b/sync/internal_api/all_status.cc @@ -70,6 +70,8 @@ sync_api::SyncManager::Status AllStatus::CalcSyncing( snapshot.syncer_status().num_tombstone_updates_downloaded_total; status.reflected_updates_received += snapshot.syncer_status().num_reflected_updates_downloaded_total; + status.num_commits_total += + snapshot.syncer_status().num_successful_commits; status.num_local_overwrites_total += snapshot.syncer_status().num_local_overwrites; status.num_server_overwrites_total += diff --git a/sync/internal_api/sync_manager.cc b/sync/internal_api/sync_manager.cc index b25c8848..4a5ade2 100644 --- a/sync/internal_api/sync_manager.cc +++ b/sync/internal_api/sync_manager.cc @@ -716,6 +716,7 @@ SyncManager::Status::Status() updates_received(0), reflected_updates_received(0), tombstone_updates_received(0), + num_commits_total(0), num_local_overwrites_total(0), num_server_overwrites_total(0), nonempty_get_updates(0), diff --git a/sync/internal_api/sync_manager.h b/sync/internal_api/sync_manager.h index 6076ab7..73229ab 100644 --- a/sync/internal_api/sync_manager.h +++ b/sync/internal_api/sync_manager.h @@ -128,10 +128,12 @@ class SyncManager { int updates_received; // Total updates received that are echoes of our own changes. int reflected_updates_received; - // Of updates_received, how many were tombstones. int tombstone_updates_received; + // Total successful commits. + int num_commits_total; + // Total number of overwrites due to conflict resolver since browser start. int num_local_overwrites_total; int num_server_overwrites_total; -- cgit v1.1