OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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. | |
4 | |
5 #ifndef CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_METRICS_H_ | |
6 #define CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_METRICS_H_ | |
7 | |
8 #include <map> | |
9 | |
10 #include "url/gurl.h" | |
11 | |
12 // Helper class managing the UMA histograms for the Site Engagement Service. | |
13 class SiteEngagementMetrics { | |
14 public: | |
15 // This is used to back a UMA histogram, so it should be treated as | |
16 // append-only. Any new values should be inserted immediately prior to | |
17 // ENGAGEMENT_LAST. | |
18 enum EngagementType { | |
19 ENGAGEMENT_NAVIGATION, | |
20 ENGAGEMENT_KEYPRESS, | |
21 ENGAGEMENT_MOUSE, | |
22 ENGAGEMENT_LAST, | |
23 }; | |
24 | |
25 static const char kTotalEngagementHistogram[]; | |
26 static const char kTotalOriginsHistogram[]; | |
27 static const char kAverageEngagementHistogram[]; | |
28 static const char kEngagementScoreHistogram[]; | |
29 static const char kOriginsWithMaxEngagementHistogram[]; | |
30 static const char kOriginsWithMaxDailyEngagementHistogram[]; | |
31 static const char kPercentOriginsWithMaxEngagementHistogram[]; | |
32 static const char kEngagementTypeHistogram[]; | |
calamity
2015/10/02 03:46:28
Can these just live in the anonymous namespace?
dominickn
2015/10/02 04:54:50
No, because they're used in tests. I've privatized
| |
33 | |
34 static void RecordTotalSiteEngagement(double total_engagement); | |
35 static void RecordTotalOriginsEngaged(int total_origins); | |
36 static void RecordAverageEngagement(double average_engagement); | |
37 static void RecordEngagementScores(std::map<GURL, double> score_map); | |
38 static void RecordOriginsWithMaxEngagement(int total_origins); | |
39 static void RecordOriginsWithMaxDailyEngagement(int total_origins); | |
40 static void RecordPercentOriginsWithMaxEngagement(double percentage); | |
41 static void RecordEngagement(EngagementType type); | |
42 }; | |
43 | |
44 #endif // CHROME_BROWSER_ENGAGEMENT_SITE_ENGAGEMENT_METRICS_H_ | |
OLD | NEW |