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

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

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/base/connection_type_histograms.h ('k') | net/base/crypto_module.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "net/base/connection_type_histograms.h"
6
7 #include "base/metrics/histogram.h"
8
9 namespace net {
10
11 // We're using a histogram as a group of counters. We're only interested in
12 // the values of the counters. Ignore the shape, average, and standard
13 // deviation of the histograms because they are meaningless.
14 //
15 // We use two groups of counters. In the first group (counter1), each counter
16 // is a boolean (0 or 1) that indicates whether the user has seen a connection
17 // of that type during that session. In the second group (counter2), each
18 // counter is the number of connections of that type the user has seen during
19 // that session.
20 //
21 // Each histogram has an unused bucket at the end to allow seamless future
22 // expansion.
23 void UpdateConnectionTypeHistograms(ConnectionType type) {
24 // TODO(wtc): Bug 74467 Move these stats up to a higher level.
25 static bool had_connection_type[NUM_OF_CONNECTION_TYPES]; // Default false.
26
27 if (type >= 0 && type < NUM_OF_CONNECTION_TYPES) {
28 if (!had_connection_type[type]) {
29 had_connection_type[type] = true;
30 UMA_HISTOGRAM_ENUMERATION("Net.HadConnectionType3",
31 type, NUM_OF_CONNECTION_TYPES);
32 }
33
34 UMA_HISTOGRAM_ENUMERATION("Net.ConnectionTypeCount3",
35 type, NUM_OF_CONNECTION_TYPES);
36 } else {
37 NOTREACHED(); // Someone's logging an invalid type!
38 }
39 }
40
41 } // namespace net
OLDNEW
« no previous file with comments | « net/base/connection_type_histograms.h ('k') | net/base/crypto_module.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698