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

Unified Diff: components/network_time/network_time_tracker.cc

Issue 2565173006: Measure time between secure time queries (Closed)
Patch Set: Created 4 years 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
Index: components/network_time/network_time_tracker.cc
diff --git a/components/network_time/network_time_tracker.cc b/components/network_time/network_time_tracker.cc
index 89d2ad7f9d27e0912092d840b49ee7e29e410de1..785749267a9f22888ce8f3a9c0c5b35efdc56ff1 100644
--- a/components/network_time/network_time_tracker.cc
+++ b/components/network_time/network_time_tracker.cc
@@ -534,8 +534,19 @@ bool NetworkTimeTracker::UpdateTimeFromResponse() {
base::TimeDelta resolution =
base::TimeDelta::FromMilliseconds(1) +
base::TimeDelta::FromSeconds(kTimeServerMaxSkewSeconds);
+
+ // Record histograms for the latency of the time query and the time delta
+ // between time fetches.
base::TimeDelta latency = tick_clock_->NowTicks() - fetch_started_;
UMA_HISTOGRAM_TIMES("NetworkTimeTracker.TimeQueryLatency", latency);
+ if (!last_fetched_time_.is_null()) {
+ UMA_HISTOGRAM_CUSTOM_TIMES("NetworkTimeTracker.TimeBetweenFetchedTimes",
+ current_time - last_fetched_time_,
+ base::TimeDelta::FromHours(1),
+ base::TimeDelta::FromDays(7), 100);
Ilya Sherman 2016/12/13 22:02:07 Hmm, do you really need 100 buckets, or would 50 s
estark 2016/12/13 22:09:36 Changed to 50. (I take it there's a cost to having
Ilya Sherman 2016/12/14 01:34:43 Yep, there's a cost on the client in terms of memo
+ }
+ last_fetched_time_ = current_time;
+
UpdateNetworkTime(current_time, resolution, latency, tick_clock_->NowTicks());
return true;
}

Powered by Google App Engine
This is Rietveld 408576698