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

Unified Diff: components/ssl_errors/error_classification.cc

Issue 2415703005: Refine NetworkTimeTracker histograms (Closed)
Patch Set: mab comments Created 4 years, 2 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 | « components/network_time/network_time_tracker_unittest.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ssl_errors/error_classification.cc
diff --git a/components/ssl_errors/error_classification.cc b/components/ssl_errors/error_classification.cc
index b6867d7bc6eeb7505cc33de57be96eef37999ce1..66aa42d215c635262aad35df4336b9197c3ab3aa 100644
--- a/components/ssl_errors/error_classification.cc
+++ b/components/ssl_errors/error_classification.cc
@@ -42,19 +42,32 @@ namespace {
// unavailable, why it was unavailable. This enum is being histogrammed
// so do not reorder or remove values.
enum NetworkClockState {
- // The clock state relative to network time is unknown because the
- // NetworkTimeTracker has no information from the network.
- NETWORK_CLOCK_STATE_UNKNOWN_NO_SYNC = 0,
+ // Value 0 was NETWORK_CLOCK_STATE_UNKNOWN_NO_SYNC, which is obsolete
+ // in favor of the finer-grained values below.
+
// The clock state relative to network time is unknown because the
// user's clock has fallen out of sync with the latest information
// from the network (due to e.g. suspend/resume).
- NETWORK_CLOCK_STATE_UNKNOWN_SYNC_LOST,
+ NETWORK_CLOCK_STATE_UNKNOWN_SYNC_LOST = 1,
// The clock is "close enough" to the network time.
NETWORK_CLOCK_STATE_OK,
// The clock is in the past relative to network time.
NETWORK_CLOCK_STATE_CLOCK_IN_PAST,
// The clock is in the future relative to network time.
NETWORK_CLOCK_STATE_CLOCK_IN_FUTURE,
+ // The clock state relative to network time is unknown because no sync
+ // attempt has been made yet.
+ NETWORK_CLOCK_STATE_UNKNOWN_NO_SYNC_ATTEMPT,
+ // The clock state relative to network time is unknown because one or
+ // more sync attempts has failed.
+ NETWORK_CLOCK_STATE_UNKNOWN_NO_SUCCESSFUL_SYNC,
+ // The clock state relative to network time is unknown because the
+ // first sync attempt is still pending.
+ NETWORK_CLOCK_STATE_UNKNOWN_FIRST_SYNC_PENDING,
+ // The clock state relative to network time is unknown because one or
+ // more time query attempts have failed, and a subsequent sync attempt
+ // is still pending.
+ NETWORK_CLOCK_STATE_UNKNOWN_SUBSEQUENT_SYNC_PENDING,
NETWORK_CLOCK_STATE_MAX
};
@@ -243,8 +256,17 @@ ClockState GetClockState(
case network_time::NetworkTimeTracker::NETWORK_TIME_SYNC_LOST:
network_state = NETWORK_CLOCK_STATE_UNKNOWN_SYNC_LOST;
break;
- case network_time::NetworkTimeTracker::NETWORK_TIME_NO_SYNC:
- network_state = NETWORK_CLOCK_STATE_UNKNOWN_NO_SYNC;
+ case network_time::NetworkTimeTracker::NETWORK_TIME_NO_SYNC_ATTEMPT:
+ network_state = NETWORK_CLOCK_STATE_UNKNOWN_NO_SYNC_ATTEMPT;
+ break;
+ case network_time::NetworkTimeTracker::NETWORK_TIME_NO_SUCCESSFUL_SYNC:
+ network_state = NETWORK_CLOCK_STATE_UNKNOWN_NO_SUCCESSFUL_SYNC;
+ break;
+ case network_time::NetworkTimeTracker::NETWORK_TIME_FIRST_SYNC_PENDING:
+ network_state = NETWORK_CLOCK_STATE_UNKNOWN_FIRST_SYNC_PENDING;
+ break;
+ case network_time::NetworkTimeTracker::NETWORK_TIME_SUBSEQUENT_SYNC_PENDING:
+ network_state = NETWORK_CLOCK_STATE_UNKNOWN_SUBSEQUENT_SYNC_PENDING;
break;
}
@@ -264,8 +286,11 @@ ClockState GetClockState(
build_time_state, CLOCK_STATE_MAX);
switch (network_state) {
- case NETWORK_CLOCK_STATE_UNKNOWN_NO_SYNC:
case NETWORK_CLOCK_STATE_UNKNOWN_SYNC_LOST:
+ case NETWORK_CLOCK_STATE_UNKNOWN_NO_SYNC_ATTEMPT:
+ case NETWORK_CLOCK_STATE_UNKNOWN_NO_SUCCESSFUL_SYNC:
+ case NETWORK_CLOCK_STATE_UNKNOWN_FIRST_SYNC_PENDING:
+ case NETWORK_CLOCK_STATE_UNKNOWN_SUBSEQUENT_SYNC_PENDING:
return build_time_state;
case NETWORK_CLOCK_STATE_OK:
return CLOCK_STATE_OK;
« no previous file with comments | « components/network_time/network_time_tracker_unittest.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698