Commit 45f1bca1 authored by Mohamed Amir Yosef's avatar Mohamed Amir Yosef Committed by Commit Bot

[Sync::USS] Add UMA to track missing bookmark permanent node after merge

Bug: 964341
Change-Id: Id669a728089030cfb7f638eaa38668ac15e2bad1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1617442
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661028}
parent 4aeec56a
......@@ -36,6 +36,47 @@ namespace sync_bookmarks {
namespace {
// Metrics: "Sync.MissingBookmarkPermanentNodes"
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class MissingPermanentNodes {
kBookmarkBar = 0,
kOtherBookmarks = 1,
kMobileBookmarks = 2,
kBookmarkBarAndOtherBookmarks = 3,
kBookmarkBarAndMobileBookmarks = 4,
kOtherBookmarksAndMobileBookmarks = 5,
kBookmarkBarAndOtherBookmarksAndMobileBookmarks = 6,
kMaxValue = kBookmarkBarAndOtherBookmarksAndMobileBookmarks,
};
void LogMissingPermanentNodes(
const SyncedBookmarkTracker::Entity* bookmark_bar,
const SyncedBookmarkTracker::Entity* other_bookmarks,
const SyncedBookmarkTracker::Entity* mobile_bookmarks) {
MissingPermanentNodes missing_nodes;
if (!bookmark_bar && other_bookmarks && mobile_bookmarks) {
missing_nodes = MissingPermanentNodes::kBookmarkBar;
} else if (bookmark_bar && !other_bookmarks && mobile_bookmarks) {
missing_nodes = MissingPermanentNodes::kOtherBookmarks;
} else if (bookmark_bar && other_bookmarks && !mobile_bookmarks) {
missing_nodes = MissingPermanentNodes::kMobileBookmarks;
} else if (!bookmark_bar && !other_bookmarks && mobile_bookmarks) {
missing_nodes = MissingPermanentNodes::kBookmarkBarAndOtherBookmarks;
} else if (!bookmark_bar && other_bookmarks && !mobile_bookmarks) {
missing_nodes = MissingPermanentNodes::kBookmarkBarAndMobileBookmarks;
} else if (bookmark_bar && !other_bookmarks && !mobile_bookmarks) {
missing_nodes = MissingPermanentNodes::kOtherBookmarksAndMobileBookmarks;
} else {
// All must be missing.
missing_nodes =
MissingPermanentNodes::kBookmarkBarAndOtherBookmarksAndMobileBookmarks;
}
UMA_HISTOGRAM_ENUMERATION("Sync.MissingBookmarkPermanentNodes",
missing_nodes);
}
// Enables scheduling bookmark model saving only upon changes in entity sync
// metadata. This would stop persisting changes to the model type state that
// doesn't involve changes to the entity metadata as well.
......@@ -203,6 +244,12 @@ void BookmarkModelTypeProcessor::OnUpdateReceived(
bookmark_model_->other_node()) ||
!bookmark_tracker_->GetEntityForBookmarkNode(
bookmark_model_->mobile_node())) {
LogMissingPermanentNodes(bookmark_tracker_->GetEntityForBookmarkNode(
bookmark_model_->bookmark_bar_node()),
bookmark_tracker_->GetEntityForBookmarkNode(
bookmark_model_->other_node()),
bookmark_tracker_->GetEntityForBookmarkNode(
bookmark_model_->mobile_node()));
StopTrackingMetadata();
bookmark_tracker_.reset();
error_handler_.Run(
......
......@@ -54706,6 +54706,16 @@ would be helpful to identify which type is being sent.
<int value="1" label="Unknown reason"/>
</enum>
<enum name="SyncMissingBookmarkPermanentNodes">
<int value="0" label="Bookmark Bar"/>
<int value="1" label="Other Bookmarks"/>
<int value="2" label="Mobile Bookmarks"/>
<int value="3" label="Bookmark Bar and Other Bookmarks"/>
<int value="4" label="Bookmarks Bar and Mobile Bookmarks"/>
<int value="5" label="Other Bookmarks and Mobile Bookmarks"/>
<int value="6" label="Bookmark Bar and Other Bookmarks and Mobile Bookmarks"/>
</enum>
<enum name="SyncModelTypes">
<int value="0" label="Unspecified"/>
<int value="1" label="Top Level Folder"/>
......@@ -126460,6 +126460,18 @@ should be kept until we use this API. -->
</summary>
</histogram>
<histogram name="Sync.MissingBookmarkPermanentNodes"
enum="SyncMissingBookmarkPermanentNodes" expires_after="M80">
<owner>mamir@chromium.org</owner>
<owner>mastiz@chromium.org</owner>
<summary>
Recorded after applying the first sync merge for Bookmarks in case of merge
failure. Merge failure is detected by missing one or more permanent nodes in
the merge result. This metric records which permanent nodes are missing.
It's recorded only for USS infrastrucre.
</summary>
</histogram>
<histogram base="true" name="Sync.ModelTypeConfigurationTime.Ephemeral"
units="ms" expires_after="2020-05-01">
<owner>jkrcal@chromium.org</owner>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment