From 17e7b20bdf6906f4bdd574a9e0d4526456f3c301 Mon Sep 17 00:00:00 2001 From: "jar@chromium.org" Date: Fri, 13 Mar 2009 20:29:58 +0000 Subject: wtc: please look at URL related code, and hooks and nits you might have commented on before. huanr: please look at sdch_filter code. The intent was no semantic change, and only change in histograms and stats gathered. I wanted to be sure I had better stats on several failure cases, as the turn-around time of adding stats to instrument such cases after they surface is just too long. The big feature is the mechanism for getting the total number of bytes passed to a filter. We use the filter context to achieve this, and then the SDCH filter can calculate compression ratio (from pre-gunzip vs post SDCH decompress). The number of bytes read was also histogrammed in a number of error scenarios, to better diagnose what is going on when these cases arrise (example: When some data is still buffered in the VCDIFF decoder). The sdch_filter destructor was getting long and hard to read with multiple if blocks, so I cleaned that up as well a bit (less indentation, and use of early returns). Nits not included in previous CL that earlier are listed as well. r=wtc,huanr Review URL: http://codereview.chromium.org/40319 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11665 0039d316-1c4b-4281-b951-d872f2087c98 --- base/histogram.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'base/histogram.h') diff --git a/base/histogram.h b/base/histogram.h index f66c9b4..7ec556f 100644 --- a/base/histogram.h +++ b/base/histogram.h @@ -59,6 +59,11 @@ 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); \ + } while (0) + // For folks that need real specific times, use this, but you'll only get // samples that are in the range (overly large samples are discarded). #define HISTOGRAM_CLIPPED_TIMES(name, sample, min, max, bucket_count) do { \ @@ -97,6 +102,8 @@ #define DHISTOGRAM_COUNTS(name, sample) HISTOGRAM_COUNTS(name, sample) #define DASSET_HISTOGRAM_COUNTS(name, sample) ASSET_HISTOGRAM_COUNTS(name, \ sample) +#define DHISTOGRAM_PERCENTAGE(name, under_one_hundred) HISTOGRAM_PERCENTAGE(\ + name, under_one_hundred) #define DHISTOGRAM_CLIPPED_TIMES(name, sample, min, max, bucket_count) \ HISTOGRAM_CLIPPED_TIMES(name, sample, min, max, bucket_count) @@ -105,6 +112,7 @@ #define DHISTOGRAM_TIMES(name, sample) do {} while (0) #define DHISTOGRAM_COUNTS(name, sample) do {} while (0) #define DASSET_HISTOGRAM_COUNTS(name, sample) do {} while (0) +#define DHISTOGRAM_PERCENTAGE(name, under_one_hundred) do {} while (0) #define DHISTOGRAM_CLIPPED_TIMES(name, sample, min, max, bucket_count) \ do {} while (0) @@ -175,6 +183,12 @@ static const int kRendererHistogramFlag = 1 << 4; counter.Add(sample); \ } while (0) +#define UMA_HISTOGRAM_PERCENTAGE(name, under_one_hundred) do { \ + static LinearHistogram counter((name), 1, 100, 101); \ + counter.SetFlags(kUmaTargetedHistogramFlag); \ + counter.Add(under_one_hundred); \ + } while (0) + //------------------------------------------------------------------------------ class Histogram : public StatsRate { -- cgit v1.1