| Index: net/disk_cache/blockfile/histogram_macros_v3.h
|
| diff --git a/net/disk_cache/blockfile/histogram_macros_v3.h b/net/disk_cache/blockfile/histogram_macros_v3.h
|
| index 16ccd063378419b930ff83fa3c8f1d3cf73f71c0..b9c45a0e9a1bda685e47440096f94c43316c87bd 100644
|
| --- a/net/disk_cache/blockfile/histogram_macros_v3.h
|
| +++ b/net/disk_cache/blockfile/histogram_macros_v3.h
|
| @@ -18,49 +18,62 @@
|
| // object is re-created.
|
|
|
| #define CACHE_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \
|
| - do { \
|
| - base::HistogramBase* counter(NULL); \
|
| - if (!counter || name != counter->histogram_name()) \
|
| - counter = base::Histogram::FactoryGet( \
|
| - name, min, max, bucket_count, \
|
| - base::Histogram::kUmaTargetedHistogramFlag); \
|
| - counter->Add(sample); \
|
| - } while (0)
|
| -
|
| -#define CACHE_HISTOGRAM_COUNTS(name, sample) CACHE_HISTOGRAM_CUSTOM_COUNTS( \
|
| - name, sample, 1, 1000000, 50)
|
| + do { \
|
| + base::HistogramBase* counter(NULL); \
|
| + if (!counter || name != counter->histogram_name()) \
|
| + counter = base::Histogram::FactoryGet( \
|
| + name, \
|
| + min, \
|
| + max, \
|
| + bucket_count, \
|
| + base::Histogram::kUmaTargetedHistogramFlag); \
|
| + counter->Add(sample); \
|
| + } while (0)
|
| +
|
| +#define CACHE_HISTOGRAM_COUNTS(name, sample) \
|
| + CACHE_HISTOGRAM_CUSTOM_COUNTS(name, sample, 1, 1000000, 50)
|
|
|
| #define CACHE_HISTOGRAM_COUNTS_10000(name, sample) \
|
| - CACHE_HISTOGRAM_CUSTOM_COUNTS(name, sample, 1, 10000, 50)
|
| + CACHE_HISTOGRAM_CUSTOM_COUNTS(name, sample, 1, 10000, 50)
|
|
|
| #define CACHE_HISTOGRAM_COUNTS_50000(name, sample) \
|
| - CACHE_HISTOGRAM_CUSTOM_COUNTS(name, sample, 1, 50000000, 50)
|
| + CACHE_HISTOGRAM_CUSTOM_COUNTS(name, sample, 1, 50000000, 50)
|
|
|
| #define CACHE_HISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) \
|
| - do { \
|
| - base::HistogramBase* counter(NULL); \
|
| - if (!counter || name != counter->histogram_name()) \
|
| - counter = base::Histogram::FactoryTimeGet( \
|
| - name, min, max, bucket_count, \
|
| - base::Histogram::kUmaTargetedHistogramFlag); \
|
| - counter->AddTime(sample); \
|
| - } while (0)
|
| -
|
| -#define CACHE_HISTOGRAM_TIMES(name, sample) CACHE_HISTOGRAM_CUSTOM_TIMES( \
|
| - name, sample, base::TimeDelta::FromMilliseconds(1), \
|
| - base::TimeDelta::FromSeconds(10), 50)
|
| -
|
| -#define CACHE_HISTOGRAM_ENUMERATION(name, sample, boundary_value) do { \
|
| - base::HistogramBase* counter(NULL); \
|
| - if (!counter || name != counter->histogram_name()) \
|
| - counter = base::LinearHistogram::FactoryGet( \
|
| - name, 1, boundary_value, boundary_value + 1, \
|
| - base::Histogram::kUmaTargetedHistogramFlag); \
|
| - counter->Add(sample); \
|
| + do { \
|
| + base::HistogramBase* counter(NULL); \
|
| + if (!counter || name != counter->histogram_name()) \
|
| + counter = base::Histogram::FactoryTimeGet( \
|
| + name, \
|
| + min, \
|
| + max, \
|
| + bucket_count, \
|
| + base::Histogram::kUmaTargetedHistogramFlag); \
|
| + counter->AddTime(sample); \
|
| + } while (0)
|
| +
|
| +#define CACHE_HISTOGRAM_TIMES(name, sample) \
|
| + CACHE_HISTOGRAM_CUSTOM_TIMES(name, \
|
| + sample, \
|
| + base::TimeDelta::FromMilliseconds(1), \
|
| + base::TimeDelta::FromSeconds(10), \
|
| + 50)
|
| +
|
| +#define CACHE_HISTOGRAM_ENUMERATION(name, sample, boundary_value) \
|
| + do { \
|
| + base::HistogramBase* counter(NULL); \
|
| + if (!counter || name != counter->histogram_name()) \
|
| + counter = base::LinearHistogram::FactoryGet( \
|
| + name, \
|
| + 1, \
|
| + boundary_value, \
|
| + boundary_value + 1, \
|
| + base::Histogram::kUmaTargetedHistogramFlag); \
|
| + counter->Add(sample); \
|
| } while (0)
|
|
|
| #define CACHE_HISTOGRAM_PERCENTAGE(name, under_one_hundred) \
|
| - CACHE_HISTOGRAM_ENUMERATION(name, under_one_hundred, 101)
|
| + CACHE_HISTOGRAM_ENUMERATION(name, under_one_hundred, 101)
|
|
|
| // -----------------------------------------------------------------------------
|
|
|
| @@ -71,16 +84,16 @@
|
| // HISTOGRAM_AGE will collect time elapsed since |initial_time|, with a
|
| // granularity of hours and normal values of a few months.
|
| #define CACHE_HISTOGRAM_AGE(name, initial_time) \
|
| - CACHE_HISTOGRAM_COUNTS_10000(name, \
|
| - (base::Time::Now() - initial_time).InHours())
|
| + CACHE_HISTOGRAM_COUNTS_10000(name, \
|
| + (base::Time::Now() - initial_time).InHours())
|
|
|
| // HISTOGRAM_AGE_MS will collect time elapsed since |initial_time|, with the
|
| // normal resolution of the UMA_HISTOGRAM_TIMES.
|
| -#define CACHE_HISTOGRAM_AGE_MS(name, initial_time)\
|
| - CACHE_HISTOGRAM_TIMES(name, base::TimeTicks::Now() - initial_time)
|
| +#define CACHE_HISTOGRAM_AGE_MS(name, initial_time) \
|
| + CACHE_HISTOGRAM_TIMES(name, base::TimeTicks::Now() - initial_time)
|
|
|
| #define CACHE_HISTOGRAM_CACHE_ERROR(name, sample) \
|
| - CACHE_HISTOGRAM_ENUMERATION(name, sample, 50)
|
| + CACHE_HISTOGRAM_ENUMERATION(name, sample, 50)
|
|
|
| // Generates a UMA histogram of the given type, generating the proper name for
|
| // it (asking backend_->HistogramName), and adding the provided sample.
|
| @@ -90,20 +103,21 @@
|
| // which may translate to:
|
| // UMA_HISTOGRAM_COUNTS("DiskCache3.MyName_AppCache", 20);
|
| //
|
| -#define CACHE_UMA(type, name, sample) {\
|
| - const std::string my_name =\
|
| - CACHE_UMA_BACKEND_IMPL_OBJ->HistogramName(name);\
|
| - switch (CACHE_UMA_BACKEND_IMPL_OBJ->cache_type()) {\
|
| - case net::DISK_CACHE:\
|
| - case net::MEDIA_CACHE:\
|
| - case net::APP_CACHE:\
|
| - case net::SHADER_CACHE:\
|
| - case net::PNACL_CACHE:\
|
| - CACHE_HISTOGRAM_##type(my_name.data(), sample);\
|
| - break;\
|
| - default:\
|
| - break;\
|
| - }\
|
| +#define CACHE_UMA(type, name, sample) \
|
| + { \
|
| + const std::string my_name = \
|
| + CACHE_UMA_BACKEND_IMPL_OBJ->HistogramName(name); \
|
| + switch (CACHE_UMA_BACKEND_IMPL_OBJ->cache_type()) { \
|
| + case net::DISK_CACHE: \
|
| + case net::MEDIA_CACHE: \
|
| + case net::APP_CACHE: \
|
| + case net::SHADER_CACHE: \
|
| + case net::PNACL_CACHE: \
|
| + CACHE_HISTOGRAM_##type(my_name.data(), sample); \
|
| + break; \
|
| + default: \
|
| + break; \
|
| + } \
|
| }
|
|
|
| #endif // NET_DISK_CACHE_BLOCKFILE_HISTOGRAM_MACROS_V3_H_
|
|
|