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 class AutoFillServerQueryMetricLogger { |
dhollowa
2010/12/12 07:07:51
I'd prefer to combine these two classes into a sin
Ilya Sherman
2010/12/13 22:13:51
Done.
| |
10 public: | |
11 // Each of these is logged at most once per query to the server, which in turn | |
12 // occurs at most once per page load. | |
13 enum Metric { | |
14 // Logged for each query sent to the server. | |
15 QUERY_SENT = 0, | |
16 // Logged for each query response received from the server. | |
17 QUERY_RESPONSE_RECEIVED, | |
18 // Logged for each parsable response received from the server. | |
19 QUERY_RESPONSE_PARSED, | |
20 // Logged for each parsable response that provided no improvements relative | |
21 // to our heuristics. | |
22 QUERY_RESPONSE_MATCHED_LOCAL_HEURISTICS, | |
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 | |
25 // least one field. | |
26 QUERY_RESPONSE_OVERRODE_LOCAL_HEURISTICS, | |
27 // Logged for each page for which our heuristics did not detect any | |
28 // auto-fillable fields, but the server response did detect some. | |
29 QUERY_RESPONSE_WITH_NO_LOCAL_HEURISTICS, | |
30 NUM_SERVER_QUERY_METRICS | |
31 }; | |
10 | 32 |
11 // Each of these should be logged at most once per query to the server, which in | 33 virtual ~AutoFillServerQueryMetricLogger(); |
12 // turn should occur at most once per page load. | 34 virtual void Log(Metric metric) const; |
13 enum ServerQueryMetricType { | |
14 // Logged for each query sent to the server | |
15 QUERY_SENT = 0, | |
16 // Logged for each query response received from the server | |
17 QUERY_RESPONSE_RECEIVED, | |
18 // Logged for each parsable response received from the server | |
19 QUERY_RESPONSE_PARSED, | |
20 // Logged for each parsable response that provided no improvements relative to | |
21 // our heuristics. | |
22 QUERY_RESPONSE_MATCHED_LOCAL_HEURISTICS, | |
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 | |
25 // one field | |
26 QUERY_RESPONSE_OVERRODE_LOCAL_HEURISTICS, | |
27 // Logged for each page for which our heuristics did not detect any | |
28 // auto-fillable fields, but the server response did detect some. | |
29 QUERY_RESPONSE_WITH_NO_LOCAL_HEURISTICS, | |
30 NUM_SERVER_QUERY_METRICS | |
31 }; | 35 }; |
32 | 36 |
33 void LogServerQueryMetric(ServerQueryMetricType type); | 37 class AutoFillQualityMetricLogger { |
38 public: | |
39 // Each of these is logged at most once per form submission. | |
40 enum Metric { | |
41 // Logged for each field in a submitted form. | |
42 FIELD_SUBMITTED = 0, | |
43 // A simple successs metric, logged for each field that returns true for | |
44 // |is_autofilled()| and has a value that is present in the personal data | |
45 // manager. There is a small chance of false positives from filling via | |
46 // autocomplete rather than autofill. | |
47 FIELD_AUTOFILLED, | |
48 // A simple failure metric, logged for each field that returns false for | |
49 // |is_autofilled()| but as a value that is present in the personal data | |
50 // manager. | |
51 FIELD_AUTOFILL_FAILED, | |
52 NUM_QUALITY_METRICS | |
53 }; | |
34 | 54 |
35 } // namespace autofill_metrics | 55 virtual ~AutoFillQualityMetricLogger(); |
56 virtual void Log(Metric metric) const; | |
57 }; | |
36 | 58 |
37 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_METRICS_H_ | 59 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_METRICS_H_ |
OLD | NEW |