Commit d84b6b65 authored by Zhongyi Shi's avatar Zhongyi Shi Committed by Commit Bot

Add histograms to collect handshake status when connection migration is...

Add histograms to collect handshake status when connection migration is triggered based on migration cause.

Bug: 790547
Change-Id: I08efdc45b558d711b310aac55f412381efc3eaa6
Reviewed-on: https://chromium-review.googlesource.com/1140532Reviewed-by: default avatarRyan Hamilton <rch@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Zhongyi Shi <zhongyi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576205}
parent b19e29b0
...@@ -1661,12 +1661,6 @@ void QuicChromiumClientSession::MigrateSessionOnWriteError( ...@@ -1661,12 +1661,6 @@ void QuicChromiumClientSession::MigrateSessionOnWriteError(
} }
current_connection_migration_cause_ = ON_WRITE_ERROR; current_connection_migration_cause_ = ON_WRITE_ERROR;
LogHandshakeStatusOnConnectionMigrationSignal();
const NetLogWithSource migration_net_log = NetLogWithSource::Make(
net_log_.net_log(), NetLogSourceType::QUIC_CONNECTION_MIGRATION);
migration_net_log.BeginEvent(
NetLogEventType::QUIC_CONNECTION_MIGRATION_TRIGGERED,
base::Bind(&NetLogQuicConnectionMigrationTriggerCallback, "WriteError"));
if (!IsSessionMigratable(/*close_session_if_not_migratable*/ false)) { if (!IsSessionMigratable(/*close_session_if_not_migratable*/ false)) {
// Close the connection if migration failed. Do not cause a // Close the connection if migration failed. Do not cause a
...@@ -1677,6 +1671,14 @@ void QuicChromiumClientSession::MigrateSessionOnWriteError( ...@@ -1677,6 +1671,14 @@ void QuicChromiumClientSession::MigrateSessionOnWriteError(
return; return;
} }
LogHandshakeStatusOnConnectionMigrationSignal();
const NetLogWithSource migration_net_log = NetLogWithSource::Make(
net_log_.net_log(), NetLogSourceType::QUIC_CONNECTION_MIGRATION);
migration_net_log.BeginEvent(
NetLogEventType::QUIC_CONNECTION_MIGRATION_TRIGGERED,
base::Bind(&NetLogQuicConnectionMigrationTriggerCallback, "WriteError"));
NetworkChangeNotifier::NetworkHandle new_network = NetworkChangeNotifier::NetworkHandle new_network =
stream_factory_->FindAlternateNetwork( stream_factory_->FindAlternateNetwork(
GetDefaultSocket()->GetBoundNetwork()); GetDefaultSocket()->GetBoundNetwork());
...@@ -1853,8 +1855,6 @@ void QuicChromiumClientSession::OnNetworkConnected( ...@@ -1853,8 +1855,6 @@ void QuicChromiumClientSession::OnNetworkConnected(
current_connection_migration_cause_ = ON_NETWORK_CONNECTED; current_connection_migration_cause_ = ON_NETWORK_CONNECTED;
} }
LogHandshakeStatusOnConnectionMigrationSignal();
if (wait_for_new_network_) { if (wait_for_new_network_) {
wait_for_new_network_ = false; wait_for_new_network_ = false;
// |wait_for_new_network_| is true, there was no working network previously. // |wait_for_new_network_| is true, there was no working network previously.
...@@ -1891,6 +1891,8 @@ void QuicChromiumClientSession::OnNetworkDisconnectedV2( ...@@ -1891,6 +1891,8 @@ void QuicChromiumClientSession::OnNetworkDisconnectedV2(
} }
current_connection_migration_cause_ = ON_NETWORK_DISCONNECTED; current_connection_migration_cause_ = ON_NETWORK_DISCONNECTED;
LogHandshakeStatusOnConnectionMigrationSignal();
// Attempt to find alternative network. // Attempt to find alternative network.
NetworkChangeNotifier::NetworkHandle new_network = NetworkChangeNotifier::NetworkHandle new_network =
stream_factory_->FindAlternateNetwork(disconnected_network); stream_factory_->FindAlternateNetwork(disconnected_network);
...@@ -1900,8 +1902,6 @@ void QuicChromiumClientSession::OnNetworkDisconnectedV2( ...@@ -1900,8 +1902,6 @@ void QuicChromiumClientSession::OnNetworkDisconnectedV2(
return; return;
} }
LogHandshakeStatusOnConnectionMigrationSignal();
// Current network is being disconnected, migrate immediately to the // Current network is being disconnected, migrate immediately to the
// alternative network. // alternative network.
MigrateImmediately(new_network); MigrateImmediately(new_network);
...@@ -1923,9 +1923,8 @@ void QuicChromiumClientSession::OnNetworkMadeDefault( ...@@ -1923,9 +1923,8 @@ void QuicChromiumClientSession::OnNetworkMadeDefault(
current_connection_migration_cause_ = ON_NETWORK_MADE_DEFAULT; current_connection_migration_cause_ = ON_NETWORK_MADE_DEFAULT;
current_migrations_to_non_default_network_on_path_degrading_ = 0; current_migrations_to_non_default_network_on_path_degrading_ = 0;
// Connection migration v2. // Simply cancel the timer to migrate back to the default network if session
// If we are already on the new network, simply cancel the timer to migrate // is already on the default network.
// back to the default network.
if (GetDefaultSocket()->GetBoundNetwork() == new_network) { if (GetDefaultSocket()->GetBoundNetwork() == new_network) {
CancelMigrateBackToDefaultNetworkTimer(); CancelMigrateBackToDefaultNetworkTimer();
HistogramAndLogMigrationFailure( HistogramAndLogMigrationFailure(
...@@ -2019,13 +2018,16 @@ void QuicChromiumClientSession::OnPathDegrading() { ...@@ -2019,13 +2018,16 @@ void QuicChromiumClientSession::OnPathDegrading() {
if (most_recent_path_degrading_timestamp_ == base::TimeTicks()) if (most_recent_path_degrading_timestamp_ == base::TimeTicks())
most_recent_path_degrading_timestamp_ = base::TimeTicks::Now(); most_recent_path_degrading_timestamp_ = base::TimeTicks::Now();
if (stream_factory_) { if (!stream_factory_)
return;
const NetLogWithSource migration_net_log = NetLogWithSource::Make( const NetLogWithSource migration_net_log = NetLogWithSource::Make(
net_log_.net_log(), NetLogSourceType::QUIC_CONNECTION_MIGRATION); net_log_.net_log(), NetLogSourceType::QUIC_CONNECTION_MIGRATION);
migration_net_log.BeginEvent( migration_net_log.BeginEvent(
NetLogEventType::QUIC_CONNECTION_MIGRATION_TRIGGERED, NetLogEventType::QUIC_CONNECTION_MIGRATION_TRIGGERED,
base::Bind(&NetLogQuicConnectionMigrationTriggerCallback, base::Bind(&NetLogQuicConnectionMigrationTriggerCallback,
"PathDegrading")); "PathDegrading"));
if (migrate_session_early_v2_) { if (migrate_session_early_v2_) {
NetworkChangeNotifier::NetworkHandle alternate_network = NetworkChangeNotifier::NetworkHandle alternate_network =
stream_factory_->FindAlternateNetwork( stream_factory_->FindAlternateNetwork(
...@@ -2062,7 +2064,6 @@ void QuicChromiumClientSession::OnPathDegrading() { ...@@ -2062,7 +2064,6 @@ void QuicChromiumClientSession::OnPathDegrading() {
} }
migration_net_log.EndEvent( migration_net_log.EndEvent(
NetLogEventType::QUIC_CONNECTION_MIGRATION_TRIGGERED); NetLogEventType::QUIC_CONNECTION_MIGRATION_TRIGGERED);
}
} }
bool QuicChromiumClientSession::HasOpenDynamicStreams() const { bool QuicChromiumClientSession::HasOpenDynamicStreams() const {
...@@ -2463,6 +2464,15 @@ void QuicChromiumClientSession::LogHandshakeStatusOnConnectionMigrationSignal() ...@@ -2463,6 +2464,15 @@ void QuicChromiumClientSession::LogHandshakeStatusOnConnectionMigrationSignal()
const { const {
UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.HandshakeStatusOnConnectionMigration", UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.HandshakeStatusOnConnectionMigration",
IsCryptoHandshakeConfirmed()); IsCryptoHandshakeConfirmed());
const std::string histogram_name =
"Net.QuicSession.HandshakeStatusOnConnectionMigration." +
ConnectionMigrationCauseToString(current_connection_migration_cause_);
STATIC_HISTOGRAM_POINTER_GROUP(
histogram_name, current_connection_migration_cause_,
MIGRATION_CAUSE_MAX, AddBoolean(IsCryptoHandshakeConfirmed()),
base::BooleanHistogram::FactoryGet(
histogram_name, base::HistogramBase::kUmaTargetedHistogramFlag));
} }
void QuicChromiumClientSession::HistogramAndLogMigrationFailure( void QuicChromiumClientSession::HistogramAndLogMigrationFailure(
......
...@@ -53515,8 +53515,8 @@ uploading your change for review. ...@@ -53515,8 +53515,8 @@ uploading your change for review.
enum="BooleanConfirmed"> enum="BooleanConfirmed">
<owner>zhongyi@chromium.org</owner> <owner>zhongyi@chromium.org</owner>
<summary> <summary>
Whether hanshake has been confirmed when the session attempts to migrate the The handshake status when when the session attempts to migrate the
connection. connection according to different migration causes.
</summary> </summary>
</histogram> </histogram>
...@@ -116300,6 +116300,8 @@ uploading your change for review. ...@@ -116300,6 +116300,8 @@ uploading your change for review.
<suffix name="Unknown"/> <suffix name="Unknown"/>
<affected-histogram name="Net.QuicSession.ConnectionMigration"/> <affected-histogram name="Net.QuicSession.ConnectionMigration"/>
<affected-histogram name="Net.QuicSession.ConnectionMigrationProbeSuccess"/> <affected-histogram name="Net.QuicSession.ConnectionMigrationProbeSuccess"/>
<affected-histogram
name="Net.QuicSession.HandshakeStatusOnConnectionMigration"/>
</histogram_suffixes> </histogram_suffixes>
<histogram_suffixes name="ConnectivityDiagnostics" separator="."> <histogram_suffixes name="ConnectivityDiagnostics" separator=".">
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment