Skip to content

Commit

Permalink
[Tango->FCM] Distinguish between known and unknown invaidation versions.
Browse files Browse the repository at this point in the history
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 <melandory@chromium.org>
Reviewed-by: Jesse Doherty <jwd@chromium.org>
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#621542}
  • Loading branch information
Tanja Gornak authored and Commit Bot committed Jan 10, 2019
1 parent 48aa04e commit c5ce55b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
16 changes: 11 additions & 5 deletions components/sync/driver/glue/sync_backend_host_core.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(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<int>(syncer::MODEL_TYPE_COUNT));
}
Expand Down Expand Up @@ -266,7 +266,8 @@ void SyncBackendHostCore::DoOnIncomingInvalidation(
ModelTypeToHistogramInt(type),
static_cast<int>(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) {
Expand All @@ -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<int>(MODEL_TYPE_COUNT));
}
std::unique_ptr<InvalidationInterface> inv_adapter(
new InvalidationAdapter(invalidation));
sync_manager_->OnIncomingInvalidation(type, std::move(inv_adapter));
Expand Down
9 changes: 9 additions & 0 deletions tools/metrics/histograms/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112883,6 +112883,15 @@ uploading your change for review.
</summary>
</histogram>

<histogram base="true" name="Sync.NonGroupedInvalidationKnownVersion"
enum="SyncModelTypes" expires_after="M75">
<owner>melandory@chromium.org</owner>
<summary>
The sync datatype of the recieved invalidation. Recorded only for the
invalidations with known version and recieved not in a group.
</summary>
</histogram>

<histogram name="Sync.PageRevisitBookmarksDuration" units="ms">
<obsolete>
Deprecated in M66.
Expand Down

0 comments on commit c5ce55b

Please sign in to comment.