Chromium Code Reviews| 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; |
| } |