Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Unified Diff: net/http/http_server_properties_manager.cc

Issue 1139843002: HttpServerProperties - Track UpdatePrefs callers. In offical builds, on (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_server_properties_manager.cc
diff --git a/net/http/http_server_properties_manager.cc b/net/http/http_server_properties_manager.cc
index 88a8466bedda45fbe54625d2c3655796f5e39de2..0307b78099e9dbd33c6db3d3776d1cb83cffa04d 100644
--- a/net/http/http_server_properties_manager.cc
+++ b/net/http/http_server_properties_manager.cc
@@ -66,6 +66,29 @@ const char kProbabilityKey[] = "probability";
const char kNetworkStatsKey[] = "network_stats";
const char kSrttKey[] = "srtt";
+enum Location {
+ SUPPORTS_SPDY = 0,
+ HTTP_11_REQUIRED = 1,
+ SET_ALTERNATIVE_SERVICE = 2,
+ MARK_ALTERNATIVE_SERVICE_BROKEN = 3,
+ MARK_ALTERNATIVE_SERVICE_RECENTLY_BROKEN = 4,
+ CONFIRM_ALTERNATIVE_SERVICE = 5,
+ CLEAR_ALTERNATIVE_SERVICE = 6,
+ SET_SPDY_SETTING = 7,
+ CLEAR_SPDY_SETTINGS = 8,
+ CLEAR_ALL_SPDY_SETTINGS = 9,
+ SET_SUPPORTS_QUIC = 10,
+ SET_SERVER_NETWORK_STATS = 11,
+ DETECTED_CORRUPTED_PREFS = 12,
+ NUM_LOCATIONS = 13,
+};
+
+// TODO(rtenneti): Delete the following histogram after collecting some data.
+void RecordUpdatePrefs(Location location) {
+ UMA_HISTOGRAM_ENUMERATION("Net.HttpServerProperties.UpdatePrefs", location,
+ NUM_LOCATIONS);
+}
+
} // namespace
////////////////////////////////////////////////////////////////////////////////
@@ -161,6 +184,7 @@ void HttpServerPropertiesManager::SetSupportsSpdy(const HostPortPair& server,
http_server_properties_impl_->SetSupportsSpdy(server, support_spdy);
ScheduleUpdatePrefsOnNetworkThread();
+ RecordUpdatePrefs(SUPPORTS_SPDY);
}
bool HttpServerPropertiesManager::RequiresHTTP11(const HostPortPair& server) {
@@ -174,6 +198,7 @@ void HttpServerPropertiesManager::SetHTTP11Required(
http_server_properties_impl_->SetHTTP11Required(server);
ScheduleUpdatePrefsOnNetworkThread();
+ RecordUpdatePrefs(HTTP_11_REQUIRED);
}
void HttpServerPropertiesManager::MaybeForceHTTP11(const HostPortPair& server,
@@ -196,6 +221,7 @@ void HttpServerPropertiesManager::SetAlternativeService(
http_server_properties_impl_->SetAlternativeService(
origin, alternative_service, alternative_probability);
ScheduleUpdatePrefsOnNetworkThread();
+ RecordUpdatePrefs(SET_ALTERNATIVE_SERVICE);
}
void HttpServerPropertiesManager::MarkAlternativeServiceBroken(
@@ -204,6 +230,7 @@ void HttpServerPropertiesManager::MarkAlternativeServiceBroken(
http_server_properties_impl_->MarkAlternativeServiceBroken(
alternative_service);
ScheduleUpdatePrefsOnNetworkThread();
+ RecordUpdatePrefs(MARK_ALTERNATIVE_SERVICE_BROKEN);
}
void HttpServerPropertiesManager::MarkAlternativeServiceRecentlyBroken(
@@ -212,6 +239,7 @@ void HttpServerPropertiesManager::MarkAlternativeServiceRecentlyBroken(
http_server_properties_impl_->MarkAlternativeServiceRecentlyBroken(
alternative_service);
ScheduleUpdatePrefsOnNetworkThread();
+ RecordUpdatePrefs(MARK_ALTERNATIVE_SERVICE_RECENTLY_BROKEN);
}
bool HttpServerPropertiesManager::IsAlternativeServiceBroken(
@@ -233,6 +261,7 @@ void HttpServerPropertiesManager::ConfirmAlternativeService(
DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
http_server_properties_impl_->ConfirmAlternativeService(alternative_service);
ScheduleUpdatePrefsOnNetworkThread();
+ RecordUpdatePrefs(CONFIRM_ALTERNATIVE_SERVICE);
}
void HttpServerPropertiesManager::ClearAlternativeService(
@@ -240,6 +269,7 @@ void HttpServerPropertiesManager::ClearAlternativeService(
DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
http_server_properties_impl_->ClearAlternativeService(origin);
ScheduleUpdatePrefsOnNetworkThread();
+ RecordUpdatePrefs(CLEAR_ALTERNATIVE_SERVICE);
}
const AlternativeServiceMap&
@@ -275,8 +305,10 @@ bool HttpServerPropertiesManager::SetSpdySetting(
DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
bool persist = http_server_properties_impl_->SetSpdySetting(
host_port_pair, id, flags, value);
- if (persist)
+ if (persist) {
ScheduleUpdatePrefsOnNetworkThread();
+ RecordUpdatePrefs(SET_SPDY_SETTING);
+ }
return persist;
}
@@ -285,12 +317,14 @@ void HttpServerPropertiesManager::ClearSpdySettings(
DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
http_server_properties_impl_->ClearSpdySettings(host_port_pair);
ScheduleUpdatePrefsOnNetworkThread();
+ RecordUpdatePrefs(CLEAR_SPDY_SETTINGS);
}
void HttpServerPropertiesManager::ClearAllSpdySettings() {
DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
http_server_properties_impl_->ClearAllSpdySettings();
ScheduleUpdatePrefsOnNetworkThread();
+ RecordUpdatePrefs(CLEAR_ALL_SPDY_SETTINGS);
}
const SpdySettingsMap& HttpServerPropertiesManager::spdy_settings_map()
@@ -311,6 +345,7 @@ void HttpServerPropertiesManager::SetSupportsQuic(
DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
http_server_properties_impl_->SetSupportsQuic(used_quic, address);
ScheduleUpdatePrefsOnNetworkThread();
+ RecordUpdatePrefs(SET_SUPPORTS_QUIC);
}
void HttpServerPropertiesManager::SetServerNetworkStats(
@@ -319,6 +354,7 @@ void HttpServerPropertiesManager::SetServerNetworkStats(
DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
http_server_properties_impl_->SetServerNetworkStats(host_port_pair, stats);
ScheduleUpdatePrefsOnNetworkThread();
+ RecordUpdatePrefs(SET_SERVER_NETWORK_STATS);
mmenke 2015/05/12 14:35:03 Suggest making this an argument to ScheduleUpdateP
ramant (doing other things) 2015/05/12 17:32:22 Doh!. Thanks and Done.
}
const ServerNetworkStats* HttpServerPropertiesManager::GetServerNetworkStats(
@@ -651,8 +687,10 @@ void HttpServerPropertiesManager::UpdateCacheFromPrefsOnNetworkThread(
server_network_stats_map);
// Update the prefs with what we have read (delete all corrupted prefs).
- if (detected_corrupted_prefs)
+ if (detected_corrupted_prefs) {
ScheduleUpdatePrefsOnNetworkThread();
+ RecordUpdatePrefs(DETECTED_CORRUPTED_PREFS);
+ }
}
//
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698