OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_METRICS_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_METRICS_H_ |
6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_METRICS_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_METRICS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 namespace autofill_metrics { | 9 namespace autofill_metrics { |
10 | 10 |
11 // Each of these should be logged at most once per query to the server, which in | 11 // Each of these is logged at most once per query to the server, which in turn |
12 // turn should occur at most once per page load. | 12 // occurs at most once per page load. |
13 enum ServerQueryMetricType { | 13 enum ServerQueryMetricType { |
14 // Logged for each query sent to the server | 14 // Logged for each query sent to the server. |
15 QUERY_SENT = 0, | 15 QUERY_SENT = 0, |
16 // Logged for each query response received from the server | 16 // Logged for each query response received from the server. |
17 QUERY_RESPONSE_RECEIVED, | 17 QUERY_RESPONSE_RECEIVED, |
18 // Logged for each parsable response received from the server | 18 // Logged for each parsable response received from the server. |
19 QUERY_RESPONSE_PARSED, | 19 QUERY_RESPONSE_PARSED, |
20 // Logged for each parsable response that provided no improvements relative to | 20 // Logged for each parsable response that provided no improvements relative to |
21 // our heuristics. | 21 // our heuristics. |
22 QUERY_RESPONSE_MATCHED_LOCAL_HEURISTICS, | 22 QUERY_RESPONSE_MATCHED_LOCAL_HEURISTICS, |
23 // Logged for each page for which our heuristics detected at least one | 23 // Logged for each page for which our heuristics detected at least one |
24 // auto-fillable field, but the server response overrode the type of at least | 24 // auto-fillable field, but the server response overrode the type of at least |
25 // one field | 25 // one field. |
26 QUERY_RESPONSE_OVERRODE_LOCAL_HEURISTICS, | 26 QUERY_RESPONSE_OVERRODE_LOCAL_HEURISTICS, |
27 // Logged for each page for which our heuristics did not detect any | 27 // Logged for each page for which our heuristics did not detect any |
28 // auto-fillable fields, but the server response did detect some. | 28 // auto-fillable fields, but the server response did detect some. |
29 QUERY_RESPONSE_WITH_NO_LOCAL_HEURISTICS, | 29 QUERY_RESPONSE_WITH_NO_LOCAL_HEURISTICS, |
30 NUM_SERVER_QUERY_METRICS | 30 NUM_SERVER_QUERY_METRICS |
31 }; | 31 }; |
32 typedef void (*LogServerQueryMetricFn)(ServerQueryMetricType); | |
33 | |
34 // Each of these is logged at most once per form submission. | |
35 enum QualityMetricType { | |
36 // Logged for each field in a submitted form. | |
37 FIELD_SUBMITTED = 0, | |
38 // A simple successs metric, logged for each field that returns true for | |
39 // |is_autofilled()| and has a value that is present in the personal data | |
40 // manager. There is a small chance of false positives from filling via | |
41 // autocomplete rather than autofill. | |
42 FIELD_AUTOFILLED, | |
43 // A simple failure metric, logged for each field that returns false for | |
44 // |is_autofilled()| but as a value that is present in the personal data | |
45 // manager. | |
46 FIELD_AUTOFILL_FAILED, | |
47 NUM_QUALITY_METRICS | |
48 }; | |
49 typedef void (*LogQualityMetricFn)(QualityMetricType); | |
dhollowa
2010/12/10 21:37:38
I think this all might be cleaner if we just chang
Ilya Sherman
2010/12/11 03:35:03
I changed this around to use two classes, one for
| |
32 | 50 |
33 void LogServerQueryMetric(ServerQueryMetricType type); | 51 void LogServerQueryMetric(ServerQueryMetricType type); |
52 void LogQualityMetric(QualityMetricType type); | |
34 | 53 |
35 } // namespace autofill_metrics | 54 } // namespace autofill_metrics |
36 | 55 |
37 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_METRICS_H_ | 56 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_METRICS_H_ |
OLD | NEW |