Chromium Code Reviews| Index: sync/engine/commit.cc |
| diff --git a/sync/engine/commit.cc b/sync/engine/commit.cc |
| index f607be4c8b4e91499e2d1184c9c8d491d6b0d7ba..a0ed654393dd984a4e7f3eb6c6ff473be12ddc56 100644 |
| --- a/sync/engine/commit.cc |
| +++ b/sync/engine/commit.cc |
| @@ -4,6 +4,7 @@ |
| #include "sync/engine/commit.h" |
| +#include "base/metrics/sparse_histogram.h" |
| #include "base/trace_event/trace_event.h" |
| #include "sync/engine/commit_contribution.h" |
| #include "sync/engine/commit_processor.h" |
| @@ -14,6 +15,13 @@ |
| #include "sync/internal_api/public/events/commit_response_event.h" |
| #include "sync/sessions/sync_session.h" |
| +#define UMA_HISTOGRAM_SPARSE_SLOWLY_WITH_VALUE(name, sample, value) \ |
| + do { \ |
| + base::HistogramBase* histogram = base::SparseHistogram::FactoryGet( \ |
| + name, base::HistogramBase::kUmaTargetedHistogramFlag); \ |
| + histogram->AddCount(sample, value); \ |
| + } while (0) |
| + |
| namespace syncer { |
| Commit::Commit(ContributionMap contributions, |
| @@ -70,11 +78,19 @@ 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) { |
| it->second->AddToCommitMessage(&message); |
| + int new_message_part_size = message.ByteSize()-previous_message_size; |
|
bengr
2015/08/07 17:13:37
I have no idea what new_message_part_size means. U
amohammadkhan
2015/08/07 18:52:30
Done.
|
| + if (new_message_part_size > 0) |
|
bengr
2015/08/07 17:13:37
Add curly braces.
amohammadkhan
2015/08/07 18:52:30
Done.
|
| + UMA_HISTOGRAM_SPARSE_SLOWLY_WITH_VALUE("DataUse.Sync.Upload.Bytes", |
| + it->first, |
| + new_message_part_size); |
| + UMA_HISTOGRAM_SPARSE_SLOWLY_WITH_VALUE("DataUse.Sync.Upload.Bytes", |
| + it->first, 1); |
| } |
| // If we made it this far, then we've successfully prepared a commit message. |