Chromium Code Reviews| Index: sync/engine/commit.cc |
| diff --git a/sync/engine/commit.cc b/sync/engine/commit.cc |
| index f607be4c8b4e91499e2d1184c9c8d491d6b0d7ba..b28989ddf19af2957b8d2c714399bfa62e7abd63 100644 |
| --- a/sync/engine/commit.cc |
| +++ b/sync/engine/commit.cc |
| @@ -13,6 +13,7 @@ |
| #include "sync/internal_api/public/events/commit_request_event.h" |
| #include "sync/internal_api/public/events/commit_response_event.h" |
| #include "sync/sessions/sync_session.h" |
| +#include "sync/util/data_type_histogram.h" |
| namespace syncer { |
| @@ -70,11 +71,21 @@ Commit* Commit::Init( |
| enabled_types, |
| commit_message); |
| + int previous_message_size = message.ByteSize(); |
| // Finally, serialize all our contributions. |
| for (std::map<ModelType, CommitContribution*>::const_iterator it = |
| contributions.begin(); |
| it != contributions.end(); ++it) { |
|
Alexei Svitkine (slow)
2015/08/24 21:27:00
Nit: Switch to C++11 for loop
amohammadkhan
2015/08/24 22:52:40
Done.
|
| it->second->AddToCommitMessage(&message); |
| + int current_entry_size = message.ByteSize() - previous_message_size; |
| + previous_message_size = message.ByteSize(); |
| + if (current_entry_size > 0) { |
| + SyncRecordDatatypeBin("DataUse.Sync.Upload.Bytes", |
| + ModelTypeToHistogramInt(it->first), |
| + current_entry_size); |
| + } |
| + UMA_HISTOGRAM_SPARSE_SLOWLY("DataUse.Sync.Upload.Count", |
| + ModelTypeToHistogramInt(it->first)); |
|
Alexei Svitkine (slow)
2015/08/24 21:27:00
Nit: Since you use ModelTypeToHistogramInt() twice
amohammadkhan
2015/08/24 22:52:40
Done.
|
| } |
| // If we made it this far, then we've successfully prepared a commit message. |