Commit 47b0b927 authored by Renjie's avatar Renjie Committed by Commit Bot

Add UMA metrics to track rate of connection ip pooling during connection.

Change-Id: Ide9efc469c6ec80c18b864579015a1dae9f75c9b
Reviewed-on: https://chromium-review.googlesource.com/c/1384987Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Reviewed-by: default avatarRyan Hamilton <rch@chromium.org>
Commit-Queue: Renjie Tang <renjietang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622141}
parent 7802e965
......@@ -157,6 +157,10 @@ void LogStaleAndFreshHostMatched(bool matched) {
UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.StaleAndFreshHostMatched", matched);
}
void LogConnectionIpPooling(bool pooled) {
UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.ConnectionIpPooled", pooled);
}
void SetInitialRttEstimate(base::TimeDelta estimate,
enum InitialRttEstimateSource source,
quic::QuicConfig* config) {
......@@ -562,6 +566,7 @@ void QuicStreamFactory::Job::OnResolveHostComplete(int rv) {
} else if (factory_->HasMatchingIpSession(key_, address_list_)) {
// Session with resolved IP has already existed, so close racing
// connection, run callback, and return.
LogConnectionIpPooling(true);
CloseStaleHostConnection();
if (!callback_.is_null())
base::ResetAndReturn(&callback_).Run(OK);
......@@ -660,8 +665,10 @@ int QuicStreamFactory::Job::DoResolveHostComplete(int rv) {
// Inform the factory of this resolution, which will set up
// a session alias, if possible.
if (factory_->HasMatchingIpSession(key_, address_list_))
if (factory_->HasMatchingIpSession(key_, address_list_)) {
LogConnectionIpPooling(true);
return OK;
}
io_state_ = STATE_CONNECT;
return OK;
......@@ -842,6 +849,7 @@ int QuicStreamFactory::Job::DoConfirmConnection(int rv) {
AddressList address(
session_->connection()->peer_address().impl().socket_address());
if (factory_->HasMatchingIpSession(key_, address)) {
LogConnectionIpPooling(true);
session_->connection()->CloseConnection(
quic::QUIC_CONNECTION_IP_POOLED,
"An active session exists for the given IP.",
......@@ -849,6 +857,7 @@ int QuicStreamFactory::Job::DoConfirmConnection(int rv) {
session_ = nullptr;
return OK;
}
LogConnectionIpPooling(false);
factory_->ActivateSession(key_, session_);
......
......@@ -61755,6 +61755,15 @@ uploading your change for review.
</summary>
</histogram>
<histogram name="Net.QuicSession.ConnectionIpPooled" enum="Boolean"
expires_after="2019-06-30">
<owner>renjietang@chromium.org</owner>
<owner>rch@chromium.org</owner>
<summary>
True if an active session already exists for a given Ip during connection.
</summary>
</histogram>
<histogram name="Net.QuicSession.ConnectionMigration"
enum="QuicConnectionMigrationStatus">
<owner>zhongyi@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