Revert of Encrypt certificate reports before uploading to HTTP URLs (patchset #20...
[chromium-blink-merge.git] / net / ftp / ftp_server_type_histograms.cc
blob84592ed023f540284f2fea63c5dad79cfe959d23
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "net/ftp/ftp_server_type_histograms.h"
7 #include "base/metrics/histogram.h"
9 namespace net {
11 // We're using a histogram as a group of counters, with one bucket for each
12 // enumeration value. We're only interested in the values of the counters.
13 // Ignore the shape, average, and standard deviation of the histograms because
14 // they are meaningless.
16 // We use two histograms. In the first histogram we tally whether the user has
17 // seen an FTP server of a given type during that session. In the second
18 // histogram we tally the number of transactions with FTP server of a given type
19 // the user has made during that session.
20 void UpdateFtpServerTypeHistograms(FtpServerType type) {
21 static bool had_server_type[NUM_OF_SERVER_TYPES];
22 if (type >= 0 && type < NUM_OF_SERVER_TYPES) {
23 if (!had_server_type[type]) {
24 had_server_type[type] = true;
25 UMA_HISTOGRAM_ENUMERATION("Net.HadFtpServerType2",
26 type, NUM_OF_SERVER_TYPES);
29 UMA_HISTOGRAM_ENUMERATION("Net.FtpServerTypeCount2",
30 type, NUM_OF_SERVER_TYPES);
33 } // namespace net