diff options
-rw-r--r-- | base/histogram.h | 16 | ||||
-rw-r--r-- | net/url_request/url_request_job.cc | 4 |
2 files changed, 18 insertions, 2 deletions
diff --git a/base/histogram.h b/base/histogram.h index d63263e..1a2b443 100644 --- a/base/histogram.h +++ b/base/histogram.h @@ -63,6 +63,11 @@ counter.Add(sample); \ } while (0) +#define HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) do { \ + static Histogram counter((name), min, max, bucket_count); \ + counter.Add(sample); \ + } while (0) + #define HISTOGRAM_PERCENTAGE(name, under_one_hundred) do { \ static LinearHistogram counter((name), 1, 100, 101); \ counter.Add(under_one_hundred); \ @@ -118,6 +123,8 @@ HISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) #define DHISTOGRAM_CLIPPED_TIMES(name, sample, min, max, bucket_count) \ HISTOGRAM_CLIPPED_TIMES(name, sample, min, max, bucket_count) +#define DHISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \ + HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) #else // NDEBUG @@ -129,6 +136,9 @@ do {} while (0) #define DHISTOGRAM_CLIPPED_TIMES(name, sample, min, max, bucket_count) \ do {} while (0) +#define DHISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \ + do {} while (0) + #endif // NDEBUG @@ -197,6 +207,12 @@ static const int kRendererHistogramFlag = 1 << 4; counter.Add(sample); \ } while (0) +#define UMA_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) do { \ + static Histogram counter((name), min, max, bucket_count); \ + counter.SetFlags(kUmaTargetedHistogramFlag); \ + counter.Add(sample); \ + } while (0) + #define UMA_HISTOGRAM_MEMORY_KB(name, sample) do { \ static Histogram counter((name), 1000, 500000, 50); \ counter.SetFlags(kUmaTargetedHistogramFlag); \ diff --git a/net/url_request/url_request_job.cc b/net/url_request/url_request_job.cc index 8f4429d..797caa6 100644 --- a/net/url_request/url_request_job.cc +++ b/net/url_request/url_request_job.cc @@ -595,8 +595,8 @@ void URLRequestJob::RecordPacketStats(StatisticSelector statistic) const { base::TimeDelta::FromMinutes(10), 100); UMA_HISTOGRAM_COUNTS_100("Sdch3.Network_Decode_Packets_b", static_cast<int>(observed_packet_count_)); - UMA_HISTOGRAM_COUNTS("Sdch3.Network_Decode_Bytes_Processed_a", - static_cast<int>(bytes_observed_in_packets_)); + UMA_HISTOGRAM_CUSTOM_COUNTS("Sdch3.Network_Decode_Bytes_Processed_b", + static_cast<int>(bytes_observed_in_packets_), 500, 100000, 100); if (packet_times_.empty()) return; UMA_HISTOGRAM_CLIPPED_TIMES("Sdch3.Network_Decode_1st_To_Last_a", |