Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3949)

Unified Diff: chrome/browser/win/jumplist.cc

Issue 2964873002: Log the ratio of the duration spent adding the two JumpList categories (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/win/jumplist.cc
diff --git a/chrome/browser/win/jumplist.cc b/chrome/browser/win/jumplist.cc
index 7ebb5eab0553e7be09175a4f82c941bac03e2de6..9e641789593c95874358a947f85e66fdf8f47a44 100644
--- a/chrome/browser/win/jumplist.cc
+++ b/chrome/browser/win/jumplist.cc
@@ -753,6 +753,9 @@ void JumpList::CreateNewJumpListAndNotifyOS(
return;
}
+ base::TimeDelta most_visited_category_time =
+ add_custom_category_timer.Elapsed();
+
// Update the "Recently Closed" category of the JumpList.
if (!jumplist_updater.AddCustomCategory(
l10n_util::GetStringUTF16(IDS_RECENTLY_CLOSED), recently_closed_pages,
@@ -760,9 +763,22 @@ void JumpList::CreateNewJumpListAndNotifyOS(
return;
}
+ base::TimeDelta add_category_total_time = add_custom_category_timer.Elapsed();
+
+ double most_visited_over_recently_closed =
+ most_visited_category_time.InMillisecondsF() /
+ (add_category_total_time - most_visited_category_time).InMillisecondsF();
Ilya Sherman 2017/07/04 03:41:19 nit: Mebbe move this into the if-stmt?
chengx 2017/07/04 06:02:16 Done.
+
+ if (recently_closed_pages.size() == kRecentlyClosedItems &&
+ most_visited_pages.size() == kMostVisitedItems) {
+ // TODO(chengx): Remove the UMA histogram after fixing crbug/736530.
+ UMA_HISTOGRAM_COUNTS_100("WinJumplist.AddCategoryTimeComparison",
+ (int)(most_visited_over_recently_closed * 10));
Ilya Sherman 2017/07/04 03:41:19 Why are you multiplying by 10? It's not clear to
chengx 2017/07/04 06:02:16 The ration is typically between 1 and 10. I multip
+ }
+
// If AddCustomCategory takes longer than the maximum allowed time, abort the
// current update and skip the next |kUpdatesToSkipUnderHeavyLoad| updates.
- if (add_custom_category_timer.Elapsed() >= kTimeOutForAddCustomCategory) {
+ if (add_category_total_time >= kTimeOutForAddCustomCategory) {
update_transaction->update_timeout = true;
return;
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698