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

Side by Side Diff: net/quic/chromium/quic_connection_logger.cc

Issue 2886933003: Use stricter type checking in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: simplify type checking Created 3 years, 5 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 unified diff | Download patch
« no previous file with comments | « net/dns/host_resolver_impl.cc ('k') | net/ssl/ssl_connection_status_flags.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/chromium/quic_connection_logger.h" 5 #include "net/quic/chromium/quic_connection_logger.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 void UpdatePublicResetAddressMismatchHistogram( 261 void UpdatePublicResetAddressMismatchHistogram(
262 const IPEndPoint& server_hello_address, 262 const IPEndPoint& server_hello_address,
263 const IPEndPoint& public_reset_address) { 263 const IPEndPoint& public_reset_address) {
264 int sample = GetAddressMismatch(server_hello_address, public_reset_address); 264 int sample = GetAddressMismatch(server_hello_address, public_reset_address);
265 // We are seemingly talking to an older server that does not support the 265 // We are seemingly talking to an older server that does not support the
266 // feature, so we can't report the results in the histogram. 266 // feature, so we can't report the results in the histogram.
267 if (sample < 0) { 267 if (sample < 0) {
268 return; 268 return;
269 } 269 }
270 UMA_HISTOGRAM_ENUMERATION("Net.QuicSession.PublicResetAddressMismatch2", 270 UMA_HISTOGRAM_ENUMERATION("Net.QuicSession.PublicResetAddressMismatch2",
271 sample, QUIC_ADDRESS_MISMATCH_MAX); 271 static_cast<QuicAddressMismatch>(sample),
272 QUIC_ADDRESS_MISMATCH_MAX);
272 } 273 }
273 274
274 // If |address| is an IPv4-mapped IPv6 address, returns ADDRESS_FAMILY_IPV4 275 // If |address| is an IPv4-mapped IPv6 address, returns ADDRESS_FAMILY_IPV4
275 // instead of ADDRESS_FAMILY_IPV6. Othewise, behaves like GetAddressFamily(). 276 // instead of ADDRESS_FAMILY_IPV6. Othewise, behaves like GetAddressFamily().
276 AddressFamily GetRealAddressFamily(const IPAddress& address) { 277 AddressFamily GetRealAddressFamily(const IPAddress& address) {
277 return address.IsIPv4MappedIPv6() ? ADDRESS_FAMILY_IPV4 278 return address.IsIPv4MappedIPv6() ? ADDRESS_FAMILY_IPV4
278 : GetAddressFamily(address); 279 : GetAddressFamily(address);
279 } 280 }
280 281
281 } // namespace 282 } // namespace
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 708
708 string prefix("Net.QuicSession.PacketLossRate_"); 709 string prefix("Net.QuicSession.PacketLossRate_");
709 base::HistogramBase* histogram = base::Histogram::FactoryGet( 710 base::HistogramBase* histogram = base::Histogram::FactoryGet(
710 prefix + connection_description_, 1, 1000, 75, 711 prefix + connection_description_, 1, 1000, 75,
711 base::HistogramBase::kUmaTargetedHistogramFlag); 712 base::HistogramBase::kUmaTargetedHistogramFlag);
712 histogram->Add(static_cast<base::HistogramBase::Sample>( 713 histogram->Add(static_cast<base::HistogramBase::Sample>(
713 ReceivedPacketLossRate() * 1000)); 714 ReceivedPacketLossRate() * 1000));
714 } 715 }
715 716
716 } // namespace net 717 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/host_resolver_impl.cc ('k') | net/ssl/ssl_connection_status_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698