summaryrefslogtreecommitdiffstats
path: root/net/disk_cache
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-28 06:59:52 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-28 06:59:52 +0000
commit2753b39e0c2e83d3b497ebadc2d720f12b74db40 (patch)
tree01edf034e65922a229b3ccbaef8291059ac5e2bc /net/disk_cache
parente660e88dc26b9b31c48c815b2358212ea4067ca5 (diff)
downloadchromium_src-2753b39e0c2e83d3b497ebadc2d720f12b74db40.zip
chromium_src-2753b39e0c2e83d3b497ebadc2d720f12b74db40.tar.gz
chromium_src-2753b39e0c2e83d3b497ebadc2d720f12b74db40.tar.bz2
Cleanup histogram classes mixing SetFlags into FactoryGet arguments
Generic cleanup of histogram class, renaming *FactoryGet to FactoryGet, along with reformatting. The macros were cleaned up to use common sub-macros rather than repeating code as much. Removed ThreadSafeHistogram (and associated ASSET_HISTOGRAM macros) since this class was not getting used. I introduced UMA_HISTOGRAM_ENUMERATION to support the common use of LinearHistograms to count various enumerated values. I added a Flags argument to all the FactoryGet routines to help avoid needing to call SetFlags each time a new sample is Add()ed. This also simplifies the code. This will all help prepare for a "don't histogram at all" macro setting so that I can test the impact of the histogram macro calls on performance (since there are now so many active histograms). BUG=31206 r=raman.tenneti Review URL: http://codereview.chromium.org/515033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35295 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache')
-rw-r--r--net/disk_cache/histogram_macros.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/net/disk_cache/histogram_macros.h b/net/disk_cache/histogram_macros.h
index 6d63dc8..17cd345 100644
--- a/net/disk_cache/histogram_macros.h
+++ b/net/disk_cache/histogram_macros.h
@@ -25,13 +25,8 @@
#define UMA_HISTOGRAM_AGE_MS(name, initial_time)\
UMA_HISTOGRAM_TIMES(name, Time::Now() - initial_time)
-#define UMA_HISTOGRAM_CACHE_ERROR(name, sample) do { \
- static scoped_refptr<Histogram> counter = \
- LinearHistogram::LinearHistogramFactoryGet(\
- (name), 1, 49, 50); \
- counter->SetFlags(kUmaTargetedHistogramFlag); \
- counter->Add(sample); \
- } while (0)
+#define UMA_HISTOGRAM_CACHE_ERROR(name, sample) \
+ UMA_HISTOGRAM_ENUMERATION(name, sample, 50)
#ifdef NET_DISK_CACHE_BACKEND_IMPL_CC_
#define BACKEND_OBJ this