| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 |
| 11 #ifndef NET_DISK_CACHE_BLOCKFILE_HISTOGRAM_MACROS_H_ | 11 #ifndef NET_DISK_CACHE_BLOCKFILE_HISTOGRAM_MACROS_H_ |
| 12 #define NET_DISK_CACHE_BLOCKFILE_HISTOGRAM_MACROS_H_ | 12 #define NET_DISK_CACHE_BLOCKFILE_HISTOGRAM_MACROS_H_ |
| 13 | 13 |
| 14 #include "base/metrics/histogram.h" |
| 15 |
| 14 // ----------------------------------------------------------------------------- | 16 // ----------------------------------------------------------------------------- |
| 15 | 17 |
| 16 // These histograms follow the definition of UMA_HISTOGRAMN_XXX except that | 18 // These histograms follow the definition of UMA_HISTOGRAMN_XXX except that |
| 17 // the counter is not cached locally. | 19 // the counter is not cached locally. |
| 18 | 20 |
| 19 #define CACHE_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \ | 21 #define CACHE_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \ |
| 20 do { \ | 22 do { \ |
| 21 base::HistogramBase* counter = base::Histogram::FactoryGet( \ | 23 base::HistogramBase* counter = base::Histogram::FactoryGet( \ |
| 22 name, min, max, bucket_count, \ | 24 name, min, max, bucket_count, \ |
| 23 base::Histogram::kUmaTargetedHistogramFlag); \ | 25 base::Histogram::kUmaTargetedHistogramFlag); \ |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 case net::MEDIA_CACHE:\ | 98 case net::MEDIA_CACHE:\ |
| 97 case net::APP_CACHE:\ | 99 case net::APP_CACHE:\ |
| 98 case net::SHADER_CACHE:\ | 100 case net::SHADER_CACHE:\ |
| 99 case net::PNACL_CACHE:\ | 101 case net::PNACL_CACHE:\ |
| 100 CACHE_HISTOGRAM_##type(my_name.data(), sample);\ | 102 CACHE_HISTOGRAM_##type(my_name.data(), sample);\ |
| 101 break;\ | 103 break;\ |
| 102 }\ | 104 }\ |
| 103 } | 105 } |
| 104 | 106 |
| 105 #endif // NET_DISK_CACHE_BLOCKFILE_HISTOGRAM_MACROS_H_ | 107 #endif // NET_DISK_CACHE_BLOCKFILE_HISTOGRAM_MACROS_H_ |
| OLD | NEW |