Chromium Code Reviews| Index: sync/engine/directory_update_handler.cc |
| diff --git a/sync/engine/directory_update_handler.cc b/sync/engine/directory_update_handler.cc |
| index adcece7baf8294db03d533eb79d2c11bc13594ab..74864f71f98b25d47dad9698d72aa07212aa3f58 100644 |
| --- a/sync/engine/directory_update_handler.cc |
| +++ b/sync/engine/directory_update_handler.cc |
| @@ -4,6 +4,7 @@ |
| #include "sync/engine/directory_update_handler.h" |
| +#include "base/metrics/sparse_histogram.h" |
| #include "sync/engine/conflict_resolver.h" |
| #include "sync/engine/process_updates_util.h" |
| #include "sync/engine/update_applicator.h" |
| @@ -13,6 +14,13 @@ |
| #include "sync/syncable/syncable_model_neutral_write_transaction.h" |
| #include "sync/syncable/syncable_write_transaction.h" |
| +#define UMA_HISTOGRAM_SPARSE_SLOWLY_WITH_VALUE(name, sample, value) \ |
|
sclittle
2015/08/10 23:39:39
This code is duplicated, could this be put in spar
amohammadkhan
2015/08/11 21:04:44
You are right and I might need this macro later to
|
| + do { \ |
| + base::HistogramBase* histogram = base::SparseHistogram::FactoryGet( \ |
| + name, base::HistogramBase::kUmaTargetedHistogramFlag); \ |
| + histogram->AddCount(sample, value); \ |
| + } while (0) |
| + |
| namespace syncer { |
| using syncable::SYNCER; |
| @@ -46,6 +54,11 @@ SyncerError DirectoryUpdateHandler::ProcessGetUpdatesResponse( |
| const SyncEntityList& applicable_updates, |
| sessions::StatusController* status) { |
| syncable::ModelNeutralWriteTransaction trans(FROM_HERE, SYNCER, dir_); |
| + if (progress_marker.ByteSize() > 0) { |
| + UMA_HISTOGRAM_SPARSE_SLOWLY_WITH_VALUE("DataUse.Sync.ProgressMarker.Bytes", |
| + ModelTypeToHistogramInt(type_), |
| + progress_marker.ByteSize()); |
| + } |
| if (mutated_context.has_context()) { |
| sync_pb::DataTypeContext local_context; |
| dir_->GetDataTypeContext(&trans, type_, &local_context); |