Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: chrome/browser/autofill/autofill_metrics.h

Issue 5703002: Add some basic success/failure UMA logging for autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Single AutoFillMetrics class, more mocks Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 AutoFillMetrics {
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 ServerQueryMetric {
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 // Each of these is logged at most once per form submission.
12 // turn should occur at most once per page load. 34 enum QualityMetric {
13 enum ServerQueryMetricType { 35 // Logged for each field in a submitted form.
14 // Logged for each query sent to the server 36 FIELD_SUBMITTED = 0,
15 QUERY_SENT = 0, 37 // A simple successs metric, logged for each field that returns true for
16 // Logged for each query response received from the server 38 // |is_autofilled()| and has a value that is present in the personal data
17 QUERY_RESPONSE_RECEIVED, 39 // manager. There is a small chance of false positives from filling via
18 // Logged for each parsable response received from the server 40 // autocomplete rather than autofill.
19 QUERY_RESPONSE_PARSED, 41 FIELD_AUTOFILLED,
20 // Logged for each parsable response that provided no improvements relative to 42 // A simple failure metric, logged for each field that returns false for
21 // our heuristics. 43 // |is_autofilled()| but as a value that is present in the personal data
22 QUERY_RESPONSE_MATCHED_LOCAL_HEURISTICS, 44 // manager.
23 // Logged for each page for which our heuristics detected at least one 45 FIELD_AUTOFILL_FAILED,
24 // auto-fillable field, but the server response overrode the type of at least 46 NUM_QUALITY_METRICS
25 // one field 47 };
26 QUERY_RESPONSE_OVERRODE_LOCAL_HEURISTICS, 48
27 // Logged for each page for which our heuristics did not detect any 49 AutoFillMetrics();
28 // auto-fillable fields, but the server response did detect some. 50 virtual ~AutoFillMetrics();
29 QUERY_RESPONSE_WITH_NO_LOCAL_HEURISTICS, 51
30 NUM_SERVER_QUERY_METRICS 52 virtual void Log(ServerQueryMetric metric) const;
53 virtual void Log(QualityMetric metric) const;
31 }; 54 };
dhollowa 2010/12/14 00:01:55 nit: DISALLOW_COPY_AND_ASSIGN(AutoFillMetrics);
32 55
33 void LogServerQueryMetric(ServerQueryMetricType type);
34
35 } // namespace autofill_metrics
36
37 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_METRICS_H_ 56 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_METRICS_H_
OLDNEW
« no previous file with comments | « chrome/browser/autofill/autofill_manager_unittest.cc ('k') | chrome/browser/autofill/autofill_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698