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

Unified Diff: chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.cc

Issue 1530763004: Add Statistics for SupervisedUserSettingService during merging and syncing data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added before and after association statistic. Created 4 years, 11 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/supervised_user/legacy/supervised_user_shared_settings_service.cc
diff --git a/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.cc b/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.cc
index 60ec741691a6160e6fb02412b393bfb035aeac18..ee03b9b76d9f15aa269151159bd70841c3c7ba5b 100644
--- a/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.cc
+++ b/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.cc
@@ -232,12 +232,14 @@ SupervisedUserSharedSettingsService::MergeDataAndStartSyncing(
SyncChangeList change_list;
const DictionaryValue* all_settings =
prefs_->GetDictionary(prefs::kSupervisedUserSharedSettings);
+ int num_association = 0;
for (DictionaryValue::Iterator it(*all_settings); !it.IsAtEnd();
it.Advance()) {
const DictionaryValue* dict = NULL;
bool success = it.value().GetAsDictionary(&dict);
DCHECK(success);
+ num_association += dict->size();
const std::set<std::string>& seen = seen_keys[it.key()];
for (DictionaryValue::Iterator jt(*dict); !jt.IsAtEnd(); jt.Advance()) {
// We only need to upload settings that we haven't seen in the initial
@@ -259,7 +261,9 @@ SupervisedUserSharedSettingsService::MergeDataAndStartSyncing(
sync_processor_->ProcessSyncChanges(FROM_HERE, change_list));
}
- // TODO(bauerb): Statistics?
+ result.set_num_items_added(change_list.size());
Bernhard Bauer 2016/01/05 09:37:30 Wait, is this right? IIUC, num_items_added is the
Deepak 2016/01/05 13:29:19 Done.
+ result.set_num_items_before_association(num_association - change_list.size());
+ result.set_num_items_after_association(num_association);
return result;
}

Powered by Google App Engine
This is Rietveld 408576698