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

Unified Diff: net/http/http_server_properties.cc

Issue 2359803003: Job Controller: clean up metrics logging about the job racing result (Closed)
Patch Set: sync Created 4 years, 3 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 | « net/http/http_server_properties.h ('k') | net/http/http_server_properties_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_server_properties.cc
diff --git a/net/http/http_server_properties.cc b/net/http/http_server_properties.cc
index 61a3901c5b7da12e7b16093d5e6e2b31dd51b440..15944114d2182530fc15773e68f806ede64faf94 100644
--- a/net/http/http_server_properties.cc
+++ b/net/http/http_server_properties.cc
@@ -12,11 +12,49 @@
namespace net {
+namespace {
+
+enum AlternativeProxyUsage {
+ // Alternative Proxy was used without racing a normal connection.
+ ALTERNATIVE_PROXY_USAGE_NO_RACE = 0,
+ // Alternative Proxy was used by winning a race with a normal connection.
+ ALTERNATIVE_PROXY_USAGE_WON_RACE = 1,
+ // Alternative Proxy was not used by losing a race with a normal connection.
+ ALTERNATIVE_PROXY_USAGE_LOST_RACE = 2,
+ // Maximum value for the enum.
+ ALTERNATIVE_PROXY_USAGE_MAX,
+};
+
+AlternativeProxyUsage ConvertProtocolUsageToProxyUsage(
+ AlternateProtocolUsage usage) {
+ switch (usage) {
+ case ALTERNATE_PROTOCOL_USAGE_NO_RACE:
+ return ALTERNATIVE_PROXY_USAGE_NO_RACE;
+ case ALTERNATE_PROTOCOL_USAGE_WON_RACE:
+ return ALTERNATIVE_PROXY_USAGE_WON_RACE;
+ case ALTERNATE_PROTOCOL_USAGE_LOST_RACE:
+ return ALTERNATIVE_PROXY_USAGE_LOST_RACE;
+ default:
+ NOTREACHED();
+ return ALTERNATIVE_PROXY_USAGE_MAX;
+ }
+}
+
+} // namespace anonymous
+
const char kAlternativeServiceHeader[] = "Alt-Svc";
-void HistogramAlternateProtocolUsage(AlternateProtocolUsage usage) {
- UMA_HISTOGRAM_ENUMERATION("Net.AlternateProtocolUsage", usage,
- ALTERNATE_PROTOCOL_USAGE_MAX);
+void HistogramAlternateProtocolUsage(AlternateProtocolUsage usage,
+ bool proxy_server_used) {
+ if (proxy_server_used) {
+ DCHECK_LE(usage, ALTERNATE_PROTOCOL_USAGE_LOST_RACE);
+ UMA_HISTOGRAM_ENUMERATION("Net.QuicAlternativeProxy.Usage",
+ ConvertProtocolUsageToProxyUsage(usage),
+ ALTERNATIVE_PROXY_USAGE_MAX);
+ } else {
+ UMA_HISTOGRAM_ENUMERATION("Net.AlternateProtocolUsage", usage,
+ ALTERNATE_PROTOCOL_USAGE_MAX);
+ }
}
void HistogramBrokenAlternateProtocolLocation(
« no previous file with comments | « net/http/http_server_properties.h ('k') | net/http/http_server_properties_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698