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

Fix histogram for new connection before handshake.

Change MigrationBeforeHandshake2 to track explicitly labeled retried
connection. ConnectionOnNonDefaultNetwork will track those connection
that started on the default network but network change is encountered
during connection setup.

Additionally, add two more histograms
- MigrationBeforeHandshakeFailedReason will track the net error code
returned when an error is encountered by the new connection on the
alternate network;
- NetworkChangeDuringMigrationBeforeHandshake will track how often the
default network is changed during migration before handshake.

Bug: 790547
Change-Id: I3ebd0e6a05a1a56d45326917f341095594333564
Reviewed-on: https://chromium-review.googlesource.com/c/1352749Reviewed-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@{#611885}
parent ab489a4d
......@@ -427,6 +427,7 @@ class QuicStreamFactory::Job {
int num_sent_client_hellos_;
bool dns_race_ongoing_;
bool host_resolution_finished_;
bool connection_retried_;
QuicChromiumClientSession* session_;
// If connection migraiton is supported, |network_| denotes the network on
// which |session_| is created.
......@@ -471,6 +472,7 @@ QuicStreamFactory::Job::Job(QuicStreamFactory* factory,
num_sent_client_hellos_(0),
dns_race_ongoing_(false),
host_resolution_finished_(false),
connection_retried_(false),
session_(nullptr),
network_(NetworkChangeNotifier::kInvalidNetworkHandle),
weak_factory_(this) {
......@@ -774,12 +776,12 @@ int QuicStreamFactory::Job::DoConfirmConnection(int rv) {
// with network idle time out or handshake time out.
DCHECK(network_ != NetworkChangeNotifier::kInvalidNetworkHandle);
network_ = factory_->FindAlternateNetwork(network_);
bool should_attempt_migration =
connection_retried_ =
network_ != NetworkChangeNotifier::kInvalidNetworkHandle;
UMA_HISTOGRAM_BOOLEAN(
"Net.QuicStreamFactory.AttemptMigrationBeforeHandshake",
should_attempt_migration);
if (should_attempt_migration) {
connection_retried_);
if (connection_retried_) {
net_log_.AddEvent(
NetLogEventType::
QUIC_STREAM_FACTORY_JOB_RETRY_ON_ALTERNATE_NETWORK);
......@@ -795,9 +797,20 @@ int QuicStreamFactory::Job::DoConfirmConnection(int rv) {
}
}
if (network_ != NetworkChangeNotifier::kInvalidNetworkHandle &&
network_ != factory_->default_network()) {
UMA_HISTOGRAM_BOOLEAN("Net.QuicStreamFactory.MigrationBeforeHandshake",
if (connection_retried_) {
UMA_HISTOGRAM_BOOLEAN("Net.QuicStreamFactory.MigrationBeforeHandshake2",
rv == OK);
if (rv == OK) {
UMA_HISTOGRAM_BOOLEAN(
"Net.QuicStreamFactory.NetworkChangeDuringMigrationBeforeHandshake",
network_ == factory_->default_network());
} else {
base::UmaHistogramSparse(
"Net.QuicStreamFactory.MigrationBeforeHandshakeFailedReason", -rv);
}
} else if (network_ != NetworkChangeNotifier::kInvalidNetworkHandle &&
network_ != factory_->default_network()) {
UMA_HISTOGRAM_BOOLEAN("Net.QuicStreamFactory.ConnectionOnNonDefaultNetwork",
rv == OK);
}
......
......@@ -61196,6 +61196,16 @@ uploading your change for review.
</summary>
</histogram>
<histogram name="Net.QuicStreamFactory.ConnectionOnNonDefaultNetwork"
enum="BooleanSuccess" expires_after="2020-12-01">
<owner>zhongyi@chromium.org</owner>
<summary>
Status of the connection on the non-default network when it finishes. A
connection may stay on the non-default network during the initial setup when
the platform's default network changes.
</summary>
</histogram>
<histogram name="Net.QuicStreamFactory.DefaultNetworkMatch"
enum="BooleanMatched">
<owner>zhongyi@chromium.org</owner>
......@@ -61218,6 +61228,9 @@ uploading your change for review.
<histogram name="Net.QuicStreamFactory.MigrationBeforeHandshake"
enum="BooleanSuccess" expires_after="2020-11-01">
<obsolete>
Deprecated 11/2018. Replaced by MigrationBeforeHandshake2.
</obsolete>
<owner>zhongyi@chromium.org</owner>
<summary>
Status of the connection which is created for migration before handshake is
......@@ -61225,6 +61238,34 @@ uploading your change for review.
</summary>
</histogram>
<histogram name="Net.QuicStreamFactory.MigrationBeforeHandshake2"
enum="BooleanSuccess" expires_after="2020-12-01">
<owner>zhongyi@chromium.org</owner>
<summary>
Status of the connection which is created for migration before handshake is
confirmed.
</summary>
</histogram>
<histogram name="Net.QuicStreamFactory.MigrationBeforeHandshakeFailedReason"
enum="NetErrorCodes" expires_after="2020-12-01">
<owner>zhongyi@chromium.org</owner>
<summary>
The network error code returned when the retried connection on the alternate
network before handshake fails.
</summary>
</histogram>
<histogram
name="Net.QuicStreamFactory.NetworkChangeDuringMigrationBeforeHandshake"
enum="BooleanChanged" expires_after="2020-12-01">
<owner>zhongyi@chromium.org</owner>
<summary>
Captures whether the default network has been changed when the new
connection succeeds on the &quot;alternate&quot; network.
</summary>
</histogram>
<histogram name="Net.QuicStreamFactory.PublicResetsPostHandshake"
units="resets">
<owner>ckrasic@chromium.org</owner>
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