From c5ce55b4233a0e461ee34dc0e8d37db25ea5c5cd Mon Sep 17 00:00:00 2001 From: Tanja Gornak Date: Thu, 10 Jan 2019 11:22:43 +0000 Subject: [PATCH] [Tango->FCM] Distinguish between known and unknown invaidation versions. Currently we count all received invalidations in order to compare new and deprecated invalidations implementation. This doesn't work well, since in the deprecated implementation invalidations with unknown versions are emited by the server. This CL distinguish between cases when invalidation has known or unknown version. Bug: 801985 Change-Id: I2a46a59c253d149932deee7e52e96379b509f718 Reviewed-on: https://chromium-review.googlesource.com/c/1400834 Commit-Queue: Tatiana Gornak Reviewed-by: Jesse Doherty Reviewed-by: Mikel Astiz Cr-Commit-Position: refs/heads/master@{#621542} --- .../sync/driver/glue/sync_backend_host_core.cc | 16 +++++++++++----- tools/metrics/histograms/histograms.xml | 9 +++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/components/sync/driver/glue/sync_backend_host_core.cc b/components/sync/driver/glue/sync_backend_host_core.cc index ccf1e3ac6fe178..ae71dd54191bf5 100644 --- a/components/sync/driver/glue/sync_backend_host_core.cc +++ b/components/sync/driver/glue/sync_backend_host_core.cc @@ -51,13 +51,13 @@ void BindFetcherToDataTracker(net::URLFetcher* fetcher) { fetcher, data_use_measurement::DataUseUserData::SYNC); } -void RecordPerModelTypeInvalidation(int model_type, int number_of_ids) { +void RecordPerModelTypeInvalidation(int model_type, bool is_grouped) { UMA_HISTOGRAM_ENUMERATION("Sync.InvalidationPerModelType", model_type, static_cast(syncer::MODEL_TYPE_COUNT)); - if (number_of_ids == 1) { + if (!is_grouped) { // When recording metrics it's important to distinguish between - // many/one case, since "many" case is only common in the deprecated - // implementation. + // many/one case, since "many" aka grouped case is only common in + // the deprecated implementation. UMA_HISTOGRAM_ENUMERATION("Sync.NonGroupedInvalidation", model_type, static_cast(syncer::MODEL_TYPE_COUNT)); } @@ -266,7 +266,8 @@ void SyncBackendHostCore::DoOnIncomingInvalidation( ModelTypeToHistogramInt(type), static_cast(MODEL_TYPE_COUNT)); - RecordPerModelTypeInvalidation(ModelTypeToHistogramInt(type), ids.size()); + bool is_grouped = (ids.size() != 1); + RecordPerModelTypeInvalidation(ModelTypeToHistogramInt(type), is_grouped); SingleObjectInvalidationSet invalidation_set = invalidation_map.ForObject(object_id); for (Invalidation invalidation : invalidation_set) { @@ -280,6 +281,11 @@ void SyncBackendHostCore::DoOnIncomingInvalidation( << last_invalidation->second; continue; } + if (!is_grouped && !invalidation.is_unknown_version()) { + UMA_HISTOGRAM_ENUMERATION("Sync.NonGroupedInvalidationKnownVersion", + ModelTypeToHistogramInt(type), + static_cast(MODEL_TYPE_COUNT)); + } std::unique_ptr inv_adapter( new InvalidationAdapter(invalidation)); sync_manager_->OnIncomingInvalidation(type, std::move(inv_adapter)); diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 54bbae05bb49ce..e849d93b8bde35 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml @@ -112883,6 +112883,15 @@ uploading your change for review. + + melandory@chromium.org + + The sync datatype of the recieved invalidation. Recorded only for the + invalidations with known version and recieved not in a group. + + + Deprecated in M66.