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

Unified Diff: chrome/browser/ui/webui/foreign_session_handler.cc

Issue 1180283002: [Sync] Add tab sync latency UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self review Created 5 years, 6 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 | « chrome/browser/ui/webui/foreign_session_handler.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/foreign_session_handler.cc
diff --git a/chrome/browser/ui/webui/foreign_session_handler.cc b/chrome/browser/ui/webui/foreign_session_handler.cc
index 2f8e1128a31b4208bd44d481ebad40dbee10d8d9..20e9ef73d343a9354106363dae59a5ceeb577780 100644
--- a/chrome/browser/ui/webui/foreign_session_handler.cc
+++ b/chrome/browser/ui/webui/foreign_session_handler.cc
@@ -12,10 +12,12 @@
#include "base/bind_helpers.h"
#include "base/i18n/time_formatting.h"
#include "base/memory/scoped_vector.h"
+#include "base/metrics/histogram_macros.h"
#include "base/prefs/pref_service.h"
#include "base/prefs/scoped_user_pref_update.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/time.h"
#include "base/values.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/profiles/profile.h"
@@ -53,6 +55,7 @@ bool SortSessionsByRecency(const SyncedSession* s1, const SyncedSession* s2) {
} // namepace
ForeignSessionHandler::ForeignSessionHandler() {
+ load_attempt_time_ = base::Time::Now();
}
// static
@@ -225,6 +228,12 @@ void ForeignSessionHandler::HandleGetForeignSessions(
base::ListValue session_list;
if (open_tabs && open_tabs->GetAllForeignSessions(&sessions)) {
+ if (!load_attempt_time_.is_null()) {
+ UMA_HISTOGRAM_TIMES("Sync.SessionsRefreshDelay",
+ base::Time::Now() - load_attempt_time_);
Alexei Svitkine (slow) 2015/06/15 14:33:28 Nit: Usually base::TimeTicks:: is used instead - t
Nicolas Zea 2015/06/15 18:01:11 Done.
+ load_attempt_time_ = base::Time();
+ }
+
// Sort sessions from most recent to least recent.
std::sort(sessions.begin(), sessions.end(), SortSessionsByRecency);
« no previous file with comments | « chrome/browser/ui/webui/foreign_session_handler.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698