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

Add histogram to track network-related platform notifications received

by QUIC users. Those notifications are:
- NetworkConnected
- NetworkMadeDefault
- NetworkDisconnected
- NetworkSoonToDisconnect
- IpAddressChanged

Bug: 765436
Change-Id: I6205540d9dbbff63010a40ef06febfede2257bef
Reviewed-on: https://chromium-review.googlesource.com/687878Reviewed-by: default avatarRyan Hamilton <rch@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Commit-Queue: Zhongyi Shi <zhongyi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504835}
parent c559001e
...@@ -181,6 +181,12 @@ void HistogramMigrationStatus(enum QuicConnectionMigrationStatus status) { ...@@ -181,6 +181,12 @@ void HistogramMigrationStatus(enum QuicConnectionMigrationStatus status) {
MIGRATION_STATUS_MAX); MIGRATION_STATUS_MAX);
} }
void LogPlatformNotificationInHistogram(
enum QuicPlatformNotification notification) {
UMA_HISTOGRAM_ENUMERATION("Net.QuicSession.PlatformNotification",
notification, NETWORK_NOTIFICATION_MAX);
}
void SetInitialRttEstimate(base::TimeDelta estimate, void SetInitialRttEstimate(base::TimeDelta estimate,
enum InitialRttEstimateSource source, enum InitialRttEstimateSource source,
QuicConfig* config) { QuicConfig* config) {
...@@ -1170,6 +1176,7 @@ void QuicStreamFactory::ClearCachedStatesInCryptoConfig( ...@@ -1170,6 +1176,7 @@ void QuicStreamFactory::ClearCachedStatesInCryptoConfig(
} }
void QuicStreamFactory::OnIPAddressChanged() { void QuicStreamFactory::OnIPAddressChanged() {
LogPlatformNotificationInHistogram(NETWORK_IP_ADDRESS_CHANGED);
// Do nothing if connection migration is in use. // Do nothing if connection migration is in use.
if (migrate_sessions_on_network_change_) if (migrate_sessions_on_network_change_)
return; return;
...@@ -1178,6 +1185,7 @@ void QuicStreamFactory::OnIPAddressChanged() { ...@@ -1178,6 +1185,7 @@ void QuicStreamFactory::OnIPAddressChanged() {
} }
void QuicStreamFactory::OnNetworkConnected(NetworkHandle network) { void QuicStreamFactory::OnNetworkConnected(NetworkHandle network) {
LogPlatformNotificationInHistogram(NETWORK_CONNECTED);
if (!migrate_sessions_on_network_change_) if (!migrate_sessions_on_network_change_)
return; return;
ScopedConnectionMigrationEventLog scoped_event_log(net_log_, ScopedConnectionMigrationEventLog scoped_event_log(net_log_,
...@@ -1192,6 +1200,7 @@ void QuicStreamFactory::OnNetworkConnected(NetworkHandle network) { ...@@ -1192,6 +1200,7 @@ void QuicStreamFactory::OnNetworkConnected(NetworkHandle network) {
} }
void QuicStreamFactory::OnNetworkMadeDefault(NetworkHandle network) { void QuicStreamFactory::OnNetworkMadeDefault(NetworkHandle network) {
LogPlatformNotificationInHistogram(NETWORK_MADE_DEFAULT);
if (most_recent_path_degrading_timestamp_ != base::TimeTicks()) { if (most_recent_path_degrading_timestamp_ != base::TimeTicks()) {
if (most_recent_network_disconnected_timestamp_ != base::TimeTicks()) { if (most_recent_network_disconnected_timestamp_ != base::TimeTicks()) {
// NetworkDiscconected happens before NetworkMadeDefault, the platform // NetworkDiscconected happens before NetworkMadeDefault, the platform
...@@ -1225,6 +1234,7 @@ void QuicStreamFactory::OnNetworkMadeDefault(NetworkHandle network) { ...@@ -1225,6 +1234,7 @@ void QuicStreamFactory::OnNetworkMadeDefault(NetworkHandle network) {
} }
void QuicStreamFactory::OnNetworkDisconnected(NetworkHandle network) { void QuicStreamFactory::OnNetworkDisconnected(NetworkHandle network) {
LogPlatformNotificationInHistogram(NETWORK_DISCONNECTED);
if (most_recent_path_degrading_timestamp_ != base::TimeTicks()) { if (most_recent_path_degrading_timestamp_ != base::TimeTicks()) {
most_recent_network_disconnected_timestamp_ = base::TimeTicks::Now(); most_recent_network_disconnected_timestamp_ = base::TimeTicks::Now();
base::TimeDelta degrading_duration = base::TimeDelta degrading_duration =
...@@ -1247,7 +1257,9 @@ void QuicStreamFactory::OnNetworkDisconnected(NetworkHandle network) { ...@@ -1247,7 +1257,9 @@ void QuicStreamFactory::OnNetworkDisconnected(NetworkHandle network) {
// This method is expected to only be called when migrating from Cellular to // This method is expected to only be called when migrating from Cellular to
// WiFi on Android, and should always be preceded by OnNetworkMadeDefault(). // WiFi on Android, and should always be preceded by OnNetworkMadeDefault().
void QuicStreamFactory::OnNetworkSoonToDisconnect(NetworkHandle network) {} void QuicStreamFactory::OnNetworkSoonToDisconnect(NetworkHandle network) {
LogPlatformNotificationInHistogram(NETWORK_SOON_TO_DISCONNECT);
}
NetworkHandle QuicStreamFactory::FindAlternateNetwork( NetworkHandle QuicStreamFactory::FindAlternateNetwork(
NetworkHandle old_network) { NetworkHandle old_network) {
......
...@@ -101,6 +101,15 @@ enum QuicConnectionMigrationStatus { ...@@ -101,6 +101,15 @@ enum QuicConnectionMigrationStatus {
MIGRATION_STATUS_MAX MIGRATION_STATUS_MAX
}; };
enum QuicPlatformNotification {
NETWORK_CONNECTED,
NETWORK_MADE_DEFAULT,
NETWORK_DISCONNECTED,
NETWORK_SOON_TO_DISCONNECT,
NETWORK_IP_ADDRESS_CHANGED,
NETWORK_NOTIFICATION_MAX
};
// Encapsulates a pending request for a QuicHttpStream. // Encapsulates a pending request for a QuicHttpStream.
// If the request is still pending when it is destroyed, it will // If the request is still pending when it is destroyed, it will
// cancel the request with the factory. // cancel the request with the factory.
......
...@@ -32815,6 +32815,14 @@ from previous Chrome versions. ...@@ -32815,6 +32815,14 @@ from previous Chrome versions.
<int value="2" label="REF_COUNT"/> <int value="2" label="REF_COUNT"/>
</enum> </enum>
<enum name="QuicPlatformNotification">
<int value="0" label="NETWORK_CONNECTED"/>
<int value="1" label="NETWORK_MADE_DEFAULT"/>
<int value="2" label="NETWORK_DISCONNECTED"/>
<int value="3" label="NETWORK_SOON_TO_DISCONNECT"/>
<int value="4" label="NETWORK_IP_ADDRESS_CHANGED"/>
</enum>
<enum name="QuicRejectReasons"> <enum name="QuicRejectReasons">
<int value="1" label="CLIENT_NONCE_UNKNOWN_FAILURE"/> <int value="1" label="CLIENT_NONCE_UNKNOWN_FAILURE"/>
<int value="2" label="CLIENT_NONCE_INVALID_FAILURE"/> <int value="2" label="CLIENT_NONCE_INVALID_FAILURE"/>
...@@ -42535,6 +42535,14 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. ...@@ -42535,6 +42535,14 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary> </summary>
</histogram> </histogram>
<histogram name="Net.QuicSession.PlatformNotification"
enum="QuicPlatformNotification">
<owner>zhongyi@chromium.org</owner>
<summary>
The platform notification received by QUIC when network change happens.
</summary>
</histogram>
<histogram name="Net.QuicSession.PreferAesGcm" enum="BooleanPreferred"> <histogram name="Net.QuicSession.PreferAesGcm" enum="BooleanPreferred">
<owner>rch@chromium.org</owner> <owner>rch@chromium.org</owner>
<summary> <summary>
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