Commit 8bfc0e2c authored by Fan Yang's avatar Fan Yang Committed by Commit Bot

Add a new histogram Net.QuicSession.NetworkProbingResult which records network...

Add a new histogram Net.QuicSession.NetworkProbingResult which records network probing results according to different migration causes.

This is a temporary change in order to understand the success/failure
rate of network probings when attempting connection migration.

Change-Id: I3c4c64cec67322a23e39c22269bc3f44790a650b
Reviewed-on: https://chromium-review.googlesource.com/973912
Commit-Queue: Fan Yang <fayang@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Reviewed-by: default avatarBrian White <bcwhite@chromium.org>
Reviewed-by: default avatarZhongyi Shi <zhongyi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546032}
parent 45b7731b
...@@ -182,6 +182,9 @@ std::string ConnectionMigrationCauseToString(ConnectionMigrationCause cause) { ...@@ -182,6 +182,9 @@ std::string ConnectionMigrationCauseToString(ConnectionMigrationCause cause) {
return "OnMigrateBackToDefaultNetwork"; return "OnMigrateBackToDefaultNetwork";
case ON_PATH_DEGRADING: case ON_PATH_DEGRADING:
return "OnPathDegrading"; return "OnPathDegrading";
default:
QUIC_NOTREACHED();
break;
} }
return "InvalidCause"; return "InvalidCause";
} }
...@@ -213,6 +216,19 @@ std::unique_ptr<base::Value> NetLogQuicPushPromiseReceivedCallback( ...@@ -213,6 +216,19 @@ std::unique_ptr<base::Value> NetLogQuicPushPromiseReceivedCallback(
return std::move(dict); return std::move(dict);
} }
// TODO(fayang): Remove this when necessary data is collected.
void LogProbeResultToHistogram(ConnectionMigrationCause cause, bool success) {
UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.ConnectionMigrationProbeSuccess",
success);
const std::string histogram_name =
"Net.QuicSession.ConnectionMigrationProbeSuccess." +
ConnectionMigrationCauseToString(cause);
STATIC_HISTOGRAM_POINTER_GROUP(
histogram_name, cause, MIGRATION_CAUSE_MAX, AddBoolean(success),
base::BooleanHistogram::FactoryGet(
histogram_name, base::HistogramBase::kUmaTargetedHistogramFlag));
}
class HpackEncoderDebugVisitor : public QuicHpackDebugVisitor { class HpackEncoderDebugVisitor : public QuicHpackDebugVisitor {
void OnUseEntry(QuicTime::Delta elapsed) override { void OnUseEntry(QuicTime::Delta elapsed) override {
UMA_HISTOGRAM_TIMES( UMA_HISTOGRAM_TIMES(
...@@ -1731,6 +1747,8 @@ void QuicChromiumClientSession::OnProbeNetworkSucceeded( ...@@ -1731,6 +1747,8 @@ void QuicChromiumClientSession::OnProbeNetworkSucceeded(
NetLogEventType::QUIC_CONNECTION_CONNECTIVITY_PROBING_SUCCEEDED, NetLogEventType::QUIC_CONNECTION_CONNECTIVITY_PROBING_SUCCEEDED,
NetLog::Int64Callback("network", network)); NetLog::Int64Callback("network", network));
LogProbeResultToHistogram(current_connection_migration_cause_, true);
// Set |this| to listen on socket write events on the packet writer // Set |this| to listen on socket write events on the packet writer
// that was used for probing. // that was used for probing.
writer->set_delegate(this); writer->set_delegate(this);
...@@ -1769,6 +1787,8 @@ void QuicChromiumClientSession::OnProbeNetworkFailed( ...@@ -1769,6 +1787,8 @@ void QuicChromiumClientSession::OnProbeNetworkFailed(
net_log_.AddEvent( net_log_.AddEvent(
NetLogEventType::QUIC_CONNECTION_CONNECTIVITY_PROBING_FAILED, NetLogEventType::QUIC_CONNECTION_CONNECTIVITY_PROBING_FAILED,
NetLog::Int64Callback("network", network)); NetLog::Int64Callback("network", network));
LogProbeResultToHistogram(current_connection_migration_cause_, false);
// Probing failure for default network can be ignored. // Probing failure for default network can be ignored.
DVLOG(1) << "Connectivity probing failed on NetworkHandle " << network; DVLOG(1) << "Connectivity probing failed on NetworkHandle " << network;
DVLOG_IF(1, network == default_network_ && DVLOG_IF(1, network == default_network_ &&
......
...@@ -90,6 +90,7 @@ enum ConnectionMigrationCause { ...@@ -90,6 +90,7 @@ enum ConnectionMigrationCause {
ON_NETWORK_MADE_DEFAULT, // With probing. ON_NETWORK_MADE_DEFAULT, // With probing.
ON_MIGRATE_BACK_TO_DEFAULT_NETWORK, // With probing. ON_MIGRATE_BACK_TO_DEFAULT_NETWORK, // With probing.
ON_PATH_DEGRADING, // With probing. ON_PATH_DEGRADING, // With probing.
MIGRATION_CAUSE_MAX
}; };
// Result of connection migration. // Result of connection migration.
......
...@@ -47644,6 +47644,16 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. ...@@ -47644,6 +47644,16 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary> </summary>
</histogram> </histogram>
<histogram name="Net.QuicSession.ConnectionMigrationProbeSuccess"
enum="BooleanSuccess">
<owner>fayang@chromium.org</owner>
<summary>
The result of connectivity probing according to different migration causes.
Recorded for every connectivity probing when attempting connection
migrations.
</summary>
</histogram>
<histogram name="Net.QuicSession.ConnectionTypeFromPeer" enum="AddressFamily"> <histogram name="Net.QuicSession.ConnectionTypeFromPeer" enum="AddressFamily">
<owner>rch@chromium.org</owner> <owner>rch@chromium.org</owner>
<summary> <summary>
...@@ -105851,6 +105861,7 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. ...@@ -105851,6 +105861,7 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
<suffix name="OnMigrateBackToDefaultNetwork"/> <suffix name="OnMigrateBackToDefaultNetwork"/>
<suffix name="OnPathDegrading"/> <suffix name="OnPathDegrading"/>
<affected-histogram name="Net.QuicSession.ConnectionMigration"/> <affected-histogram name="Net.QuicSession.ConnectionMigration"/>
<affected-histogram name="Net.QuicSession.ConnectionMigrationProbeSuccess"/>
</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