From 7df299ebed0b030135df51b9ca7ed8357b51a783 Mon Sep 17 00:00:00 2001
From: Rushan Suleymanov <rushans@google.com>
Date: Wed, 14 Oct 2020 07:37:05 +0000
Subject: [PATCH] Clean up some obsolete bookmark-related histograms

Removed histograms:
* Bookmarks.CreateBookmarkIndexTime
* Bookmarks.DecodeTime
* Bookmarks.DuplicateAndEmptyTitleDetectionTime

Bug: 993078
Change-Id: I176bc52a69b24fa2cca65d3de097a2fffb4393ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2463576
Reviewed-by: Mikel Astiz <mastiz@chromium.org>
Reviewed-by: Weilun Shi <sweilun@chromium.org>
Reviewed-by: Steven Holte <holte@chromium.org>
Commit-Queue: Rushan Suleymanov <rushans@google.com>
Cr-Commit-Position: refs/heads/master@{#816921}
---
 components/bookmarks/browser/model_loader.cc        | 13 +------------
 .../histograms/histograms_xml/others/histograms.xml |  9 +++++++++
 2 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/components/bookmarks/browser/model_loader.cc b/components/bookmarks/browser/model_loader.cc
index 28d04dcb55c39..da66510891e8a 100644
--- a/components/bookmarks/browser/model_loader.cc
+++ b/components/bookmarks/browser/model_loader.cc
@@ -96,7 +96,6 @@ void LoadBookmarks(const base::FilePath& path,
       int64_t max_node_id = 0;
       std::string sync_metadata_str;
       BookmarkCodec codec;
-      base::TimeTicks start_time = base::TimeTicks::Now();
       codec.Decode(*root, details->bb_node(), details->other_folder_node(),
                    details->mobile_folder_node(), &max_node_id,
                    &sync_metadata_str);
@@ -107,8 +106,6 @@ void LoadBookmarks(const base::FilePath& path,
       details->set_ids_reassigned(codec.ids_reassigned());
       details->set_guids_reassigned(codec.guids_reassigned());
       details->set_model_meta_info_map(codec.model_meta_info_map());
-      base::UmaHistogramTimes("Bookmarks.DecodeTime",
-                              base::TimeTicks::Now() - start_time);
 
       load_index = true;
     }
@@ -120,10 +117,7 @@ void LoadBookmarks(const base::FilePath& path,
   // Load any extra root nodes now, after the IDs have been potentially
   // reassigned.
   if (load_index) {
-    base::TimeTicks start_time = base::TimeTicks::Now();
     AddBookmarksToIndex(details, details->root_node());
-    base::UmaHistogramTimes("Bookmarks.CreateBookmarkIndexTime",
-                            base::TimeTicks::Now() - start_time);
   }
 
   details->CreateUrlIndex();
@@ -133,16 +127,11 @@ void LoadBookmarks(const base::FilePath& path,
       base::saturated_cast<int>(details->url_index()->UrlCount()));
 
   if (emit_experimental_uma && details->root_node()) {
-    base::TimeTicks start_time = base::TimeTicks::Now();
-
-    int num_duplicate_urls = GetNumDuplicateUrls(details->root_node());
+    const int num_duplicate_urls = GetNumDuplicateUrls(details->root_node());
     if (num_duplicate_urls > 0) {
       base::UmaHistogramCounts10000(
           "Bookmarks.Count.OnProfileLoad.DuplicateUrl", num_duplicate_urls);
     }
-
-    base::UmaHistogramTimes("Bookmarks.DuplicateAndEmptyTitleDetectionTime",
-                            base::TimeTicks::Now() - start_time);
   }
 }
 
diff --git a/tools/metrics/histograms/histograms_xml/others/histograms.xml b/tools/metrics/histograms/histograms_xml/others/histograms.xml
index 1902d0b8f34e6..0e6f460b1f9e8 100644
--- a/tools/metrics/histograms/histograms_xml/others/histograms.xml
+++ b/tools/metrics/histograms/histograms_xml/others/histograms.xml
@@ -1502,6 +1502,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
 
 <histogram name="Bookmarks.CreateBookmarkIndexTime" units="ms"
     expires_after="M88">
+  <obsolete>
+    Removed in M88.
+  </obsolete>
   <owner>mastiz@chromium.org</owner>
   <owner>sky@chromium.org</owner>
   <summary>
@@ -1511,6 +1514,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
 </histogram>
 
 <histogram name="Bookmarks.DecodeTime" units="ms" expires_after="M88">
+  <obsolete>
+    Removed in M88.
+  </obsolete>
   <owner>mastiz@chromium.org</owner>
   <owner>sky@chromium.org</owner>
   <summary>
@@ -1521,6 +1527,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
 
 <histogram name="Bookmarks.DuplicateAndEmptyTitleDetectionTime" units="ms"
     expires_after="2019-09-24">
+  <obsolete>
+    Removed in M88.
+  </obsolete>
   <owner>mamir@chromium.org</owner>
   <owner>mastiz@chromium.org</owner>
   <summary>