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

Side by Side Diff: net/disk_cache/v3/histogram_macros.h

Issue 121643003: Reorganize net/disk_cache into backend specific directories. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: #define fixes Created 6 years, 10 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 // This file contains macros to simplify histogram reporting from the disk 5 // This file contains macros to simplify histogram reporting from the disk
6 // cache. The main issue is that we want to have separate histograms for each 6 // cache. The main issue is that we want to have separate histograms for each
7 // type of cache (regular vs. media, etc), without adding the complexity of 7 // type of cache (regular vs. media, etc), without adding the complexity of
8 // keeping track of a potentially large number of histogram objects that have to 8 // keeping track of a potentially large number of histogram objects that have to
9 // survive the backend object that created them. 9 // survive the backend object that created them.
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 (base::Time::Now() - initial_time).InHours()) 77 (base::Time::Now() - initial_time).InHours())
78 78
79 // HISTOGRAM_AGE_MS will collect time elapsed since |initial_time|, with the 79 // HISTOGRAM_AGE_MS will collect time elapsed since |initial_time|, with the
80 // normal resolution of the UMA_HISTOGRAM_TIMES. 80 // normal resolution of the UMA_HISTOGRAM_TIMES.
81 #define CACHE_HISTOGRAM_AGE_MS(name, initial_time)\ 81 #define CACHE_HISTOGRAM_AGE_MS(name, initial_time)\
82 CACHE_HISTOGRAM_TIMES(name, base::TimeTicks::Now() - initial_time) 82 CACHE_HISTOGRAM_TIMES(name, base::TimeTicks::Now() - initial_time)
83 83
84 #define CACHE_HISTOGRAM_CACHE_ERROR(name, sample) \ 84 #define CACHE_HISTOGRAM_CACHE_ERROR(name, sample) \
85 CACHE_HISTOGRAM_ENUMERATION(name, sample, 50) 85 CACHE_HISTOGRAM_ENUMERATION(name, sample, 50)
86 86
87 #ifdef NET_DISK_CACHE_BACKEND_IMPL_CC_ 87 #ifdef NET_DISK_CACHE_V2_BACKEND_IMPL_CC_
rvargas (doing something else) 2014/02/06 04:21:23 no version prefix
gavinp 2014/02/09 15:13:35 See https://codereview.chromium.org/140893013/
88 #define BACKEND_OBJ this 88 #define BACKEND_OBJ this
89 #else 89 #else
90 #define BACKEND_OBJ backend_ 90 #define BACKEND_OBJ backend_
91 #endif 91 #endif
92 92
93 // Generates a UMA histogram of the given type, generating the proper name for 93 // Generates a UMA histogram of the given type, generating the proper name for
94 // it (asking backend_->HistogramName), and adding the provided sample. 94 // it (asking backend_->HistogramName), and adding the provided sample.
95 // For example, to generate a regualar UMA_HISTOGRAM_COUNTS, this macro would 95 // For example, to generate a regualar UMA_HISTOGRAM_COUNTS, this macro would
96 // be used as: 96 // be used as:
97 // CACHE_UMA(COUNTS, "MyName", 20); 97 // CACHE_UMA(COUNTS, "MyName", 20);
(...skipping 17 matching lines...) Expand all
115 break;\ 115 break;\
116 case net::PNACL_CACHE:\ 116 case net::PNACL_CACHE:\
117 CACHE_HISTOGRAM_##type(my_name.data(), sample);\ 117 CACHE_HISTOGRAM_##type(my_name.data(), sample);\
118 break;\ 118 break;\
119 default:\ 119 default:\
120 break;\ 120 break;\
121 }\ 121 }\
122 } 122 }
123 123
124 #endif // NET_DISK_CACHE_V3_HISTOGRAM_MACROS_H_ 124 #endif // NET_DISK_CACHE_V3_HISTOGRAM_MACROS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698