| Index: net/ftp/ftp_server_type_histograms.cc
|
| ===================================================================
|
| --- net/ftp/ftp_server_type_histograms.cc (revision 35277)
|
| +++ net/ftp/ftp_server_type_histograms.cc (working copy)
|
| @@ -8,38 +8,26 @@
|
|
|
| namespace net {
|
|
|
| -// We're using a histogram as a group of counters. We're only interested in
|
| -// the values of the counters. Ignore the shape, average, and standard
|
| -// deviation of the histograms because they are meaningless.
|
| +// We're using a histogram as a group of counters, with one bucket for each
|
| +// enumeration value. We're only interested in the values of the counters.
|
| +// Ignore the shape, average, and standard deviation of the histograms because
|
| +// they are meaningless.
|
| //
|
| -// We use two groups of counters. In the first group (counter1), each counter
|
| -// is a boolean (0 or 1) that indicates whether the user has seen an FTP server
|
| -// of that type during that session. In the second group (counter2), each
|
| -// counter is the number of transactions with FTP server of that type the user
|
| -// has made during that session.
|
| -//
|
| -// Each histogram has an unused bucket at the end to allow seamless future
|
| -// expansion.
|
| +// We use two histograms. In the first histogram we tally whether the user has
|
| +// seen an FTP server of a given type during that session. In the second
|
| +// histogram we tally the number of transactions with FTP server of a given type
|
| +// the user has made during that session.
|
| void UpdateFtpServerTypeHistograms(FtpServerType type) {
|
| static bool had_server_type[NUM_OF_SERVER_TYPES];
|
| - static scoped_refptr<Histogram> counter1 =
|
| - LinearHistogram::LinearHistogramFactoryGet("Net.HadFtpServerType",
|
| - 1, NUM_OF_SERVER_TYPES,
|
| - NUM_OF_SERVER_TYPES + 1);
|
| - static scoped_refptr<Histogram> counter2 =
|
| - LinearHistogram::LinearHistogramFactoryGet("Net.FtpServerTypeCount",
|
| - 1, NUM_OF_SERVER_TYPES,
|
| - NUM_OF_SERVER_TYPES + 1);
|
| -
|
| if (type >= 0 && type < NUM_OF_SERVER_TYPES) {
|
| if (!had_server_type[type]) {
|
| had_server_type[type] = true;
|
| - counter1->SetFlags(kUmaTargetedHistogramFlag);
|
| - counter1->Add(type);
|
| + UMA_HISTOGRAM_ENUMERATION("Net.HadFtpServerType",
|
| + type, NUM_OF_SERVER_TYPES);
|
| }
|
| }
|
| - counter2->SetFlags(kUmaTargetedHistogramFlag);
|
| - counter2->Add(type);
|
| + UMA_HISTOGRAM_ENUMERATION("Net.FtpServerTypeCount",
|
| + type, NUM_OF_SERVER_TYPES);
|
| }
|
|
|
| } // namespace net
|
|
|