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

Side by Side Diff: net/base/network_change_notifier.cc

Issue 253203002: Log operator code histogram on new metric log (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@api_move
Patch Set: combine and rename metric name. Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base/network_change_notifier.h" 5 #include "net/base/network_change_notifier.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/synchronization/lock.h" 8 #include "base/synchronization/lock.h"
9 #include "base/threading/thread_checker.h" 9 #include "base/threading/thread_checker.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 unsigned mcc_mnc = 0; 241 unsigned mcc_mnc = 0;
242 if (type == NetworkChangeNotifier::CONNECTION_2G || 242 if (type == NetworkChangeNotifier::CONNECTION_2G ||
243 type == NetworkChangeNotifier::CONNECTION_3G || 243 type == NetworkChangeNotifier::CONNECTION_3G ||
244 type == NetworkChangeNotifier::CONNECTION_4G) { 244 type == NetworkChangeNotifier::CONNECTION_4G) {
245 // Log zero if not perfectly converted. 245 // Log zero if not perfectly converted.
246 if (!base::StringToUint( 246 if (!base::StringToUint(
247 net::android::GetTelephonyNetworkOperator(), &mcc_mnc)) { 247 net::android::GetTelephonyNetworkOperator(), &mcc_mnc)) {
248 mcc_mnc = 0; 248 mcc_mnc = 0;
249 } 249 }
250 } 250 }
251 UMA_HISTOGRAM_SPARSE_SLOWLY( 251 UMA_HISTOGRAM_SPARSE_SLOWLY("NCN.NetworkOperatorMCCMNC", mcc_mnc);
252 "NCN.NetworkOperatorMCCMNC_ConnectionChange", mcc_mnc);
253 #endif 252 #endif
254 253
255 UMA_HISTOGRAM_MEDIUM_TIMES( 254 UMA_HISTOGRAM_MEDIUM_TIMES(
256 "NCN.IPAddressChangeToConnectionTypeChange", 255 "NCN.IPAddressChangeToConnectionTypeChange",
257 now - last_ip_address_change_); 256 now - last_ip_address_change_);
258 257
259 offline_packets_received_ = 0; 258 offline_packets_received_ = 0;
260 bytes_read_since_last_connection_change_ = 0; 259 bytes_read_since_last_connection_change_ = 0;
261 peak_kbps_since_last_connection_change_ = 0; 260 peak_kbps_since_last_connection_change_ = 0;
262 last_connection_type_ = type; 261 last_connection_type_ = type;
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 DCHECK(g_network_change_notifier); 765 DCHECK(g_network_change_notifier);
767 g_network_change_notifier = NULL; 766 g_network_change_notifier = NULL;
768 } 767 }
769 768
770 NetworkChangeNotifier::DisableForTest::~DisableForTest() { 769 NetworkChangeNotifier::DisableForTest::~DisableForTest() {
771 DCHECK(!g_network_change_notifier); 770 DCHECK(!g_network_change_notifier);
772 g_network_change_notifier = network_change_notifier_; 771 g_network_change_notifier = network_change_notifier_;
773 } 772 }
774 773
775 } // namespace net 774 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698