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

Side by Side Diff: net/socket/client_socket_pool_histograms.cc

Issue 2423004: Refactored Histogram::FactoryGet() to be style-compliant... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « net/disk_cache/histogram_macros.h ('k') | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/socket/client_socket_pool_histograms.h" 5 #include "net/socket/client_socket_pool_histograms.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/histogram.h" 9 #include "base/histogram.h"
10 #include "net/socket/client_socket_handle.h" 10 #include "net/socket/client_socket_handle.h"
11 11
12 namespace net { 12 namespace net {
13 13
14 ClientSocketPoolHistograms::ClientSocketPoolHistograms( 14 ClientSocketPoolHistograms::ClientSocketPoolHistograms(
15 const std::string& pool_name) { 15 const std::string& pool_name) {
16 // UMA_HISTOGRAM_ENUMERATION 16 // UMA_HISTOGRAM_ENUMERATION
17 socket_type_ = LinearHistogram::FactoryGet("Net.SocketType_" + pool_name, 1, 17 socket_type_ = LinearHistogram::FactoryGet("Net.SocketType_" + pool_name, 1,
18 ClientSocketHandle::NUM_TYPES, ClientSocketHandle::NUM_TYPES + 1, 18 ClientSocketHandle::NUM_TYPES, ClientSocketHandle::NUM_TYPES + 1,
19 Histogram::kUmaTargetedHistogramFlag); 19 Histogram::kUmaTargetedHistogramFlag);
20 // UMA_HISTOGRAM_CUSTOM_TIMES 20 // UMA_HISTOGRAM_CUSTOM_TIMES
21 request_time_ = Histogram::FactoryGet( 21 request_time_ = Histogram::FactoryTimeGet(
22 "Net.SocketRequestTime_" + pool_name, 22 "Net.SocketRequestTime_" + pool_name,
23 base::TimeDelta::FromMilliseconds(1), 23 base::TimeDelta::FromMilliseconds(1),
24 base::TimeDelta::FromMinutes(10), 24 base::TimeDelta::FromMinutes(10),
25 100, Histogram::kUmaTargetedHistogramFlag); 25 100, Histogram::kUmaTargetedHistogramFlag);
26 // UMA_HISTOGRAM_CUSTOM_TIMES 26 // UMA_HISTOGRAM_CUSTOM_TIMES
27 unused_idle_time_ = Histogram::FactoryGet( 27 unused_idle_time_ = Histogram::FactoryTimeGet(
28 "Net.SocketIdleTimeBeforeNextUse_UnusedSocket_" + pool_name, 28 "Net.SocketIdleTimeBeforeNextUse_UnusedSocket_" + pool_name,
29 base::TimeDelta::FromMilliseconds(1), 29 base::TimeDelta::FromMilliseconds(1),
30 base::TimeDelta::FromMinutes(6), 30 base::TimeDelta::FromMinutes(6),
31 100, Histogram::kUmaTargetedHistogramFlag); 31 100, Histogram::kUmaTargetedHistogramFlag);
32 // UMA_HISTOGRAM_CUSTOM_TIMES 32 // UMA_HISTOGRAM_CUSTOM_TIMES
33 reused_idle_time_ = Histogram::FactoryGet( 33 reused_idle_time_ = Histogram::FactoryTimeGet(
34 "Net.SocketIdleTimeBeforeNextUse_ReusedSocket_" + pool_name, 34 "Net.SocketIdleTimeBeforeNextUse_ReusedSocket_" + pool_name,
35 base::TimeDelta::FromMilliseconds(1), 35 base::TimeDelta::FromMilliseconds(1),
36 base::TimeDelta::FromMinutes(6), 36 base::TimeDelta::FromMinutes(6),
37 100, Histogram::kUmaTargetedHistogramFlag); 37 100, Histogram::kUmaTargetedHistogramFlag);
38 } 38 }
39 39
40 void ClientSocketPoolHistograms::AddSocketType(int type) const { 40 void ClientSocketPoolHistograms::AddSocketType(int type) const {
41 socket_type_->Add(type); 41 socket_type_->Add(type);
42 } 42 }
43 43
44 void ClientSocketPoolHistograms::AddRequestTime(base::TimeDelta time) const { 44 void ClientSocketPoolHistograms::AddRequestTime(base::TimeDelta time) const {
45 request_time_->AddTime(time); 45 request_time_->AddTime(time);
46 } 46 }
47 47
48 void ClientSocketPoolHistograms::AddUnusedIdleTime(base::TimeDelta time) const { 48 void ClientSocketPoolHistograms::AddUnusedIdleTime(base::TimeDelta time) const {
49 unused_idle_time_->AddTime(time); 49 unused_idle_time_->AddTime(time);
50 } 50 }
51 51
52 void ClientSocketPoolHistograms::AddReusedIdleTime(base::TimeDelta time) const { 52 void ClientSocketPoolHistograms::AddReusedIdleTime(base::TimeDelta time) const {
53 reused_idle_time_->AddTime(time); 53 reused_idle_time_->AddTime(time);
54 } 54 }
55 55
56 } // namespace net 56 } // namespace net
OLDNEW
« no previous file with comments | « net/disk_cache/histogram_macros.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698