Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 // the prompt was hidden. | 311 // the prompt was hidden. |
| 312 SAVE_CARD_PROMPT_END_NAVIGATION_HIDDEN, | 312 SAVE_CARD_PROMPT_END_NAVIGATION_HIDDEN, |
| 313 // The prompt was dismissed because the user clicked the "Learn more" link. | 313 // The prompt was dismissed because the user clicked the "Learn more" link. |
| 314 SAVE_CARD_PROMPT_DISMISS_CLICK_LEARN_MORE, | 314 SAVE_CARD_PROMPT_DISMISS_CLICK_LEARN_MORE, |
| 315 // The prompt was dismissed because the user clicked a legal message link. | 315 // The prompt was dismissed because the user clicked a legal message link. |
| 316 SAVE_CARD_PROMPT_DISMISS_CLICK_LEGAL_MESSAGE, | 316 SAVE_CARD_PROMPT_DISMISS_CLICK_LEGAL_MESSAGE, |
| 317 | 317 |
| 318 NUM_SAVE_CARD_PROMPT_METRICS, | 318 NUM_SAVE_CARD_PROMPT_METRICS, |
| 319 }; | 319 }; |
| 320 | 320 |
| 321 // Metrics measuring how well we predict field types. Exactly three such | 321 // Metrics measuring how well we predict field types. These metric values are |
| 322 // metrics are logged for each fillable field in a submitted form: for | 322 // logged for each field in a submitted form for: |
| 323 // the heuristic prediction, for the crowd-sourced prediction, and for the | 323 // - the heuristic prediction; |
| 324 // overall prediction. | 324 // - the crowd-sourced (server) prediction; and, |
|
sebsg
2017/05/24 14:09:01
nit: remove the and?
Roger McFarlane (Chromium)
2017/05/24 15:36:12
Done.
| |
| 325 // - for the overall prediction. | |
| 326 // | |
| 327 // For each of these prediction types, these metrics are also logger by | |
| 328 // actual and predicted field type. | |
| 325 enum FieldTypeQualityMetric { | 329 enum FieldTypeQualityMetric { |
| 326 // The field was found to be of type T, but autofill made no prediction. | 330 // The field is of type T, but autofill did not make a type prediction. |
| 327 TYPE_UNKNOWN = 0, | 331 // i.e., actual_type == T, predicted_type = UNKNOWN, T != UNKNOWN. |
| 332 // | |
| 333 // This is captured as a type-specific log entry for T. Is is also captured | |
| 334 // as an aggregate (non-type-specific) log entry. | |
| 335 FALSE_NEGATIVE_UNKNOWN, | |
| 336 | |
| 328 // The field was found to be of type T, which matches the predicted type. | 337 // The field was found to be of type T, which matches the predicted type. |
| 329 TYPE_MATCH, | 338 // i.e. actual_type == predicted type == T |
| 330 // The field was found to be of type T, autofill predicted some other type. | 339 // |
| 331 TYPE_MISMATCH, | 340 // This is captured as a type-specific log entry for T. Is is also captured |
| 332 // The field was left empty and autofil predicted that the field type would | 341 // as an aggregate (non-type-specific) log entry. |
| 333 // be UNKNOWN. | 342 TRUE_POSITIVE, |
| 334 TYPE_MATCH_EMPTY, | 343 |
| 335 // The field was populated with data that did not match any part of the | 344 // The field is of type T, but autofill predicted it to be of type U. |
| 336 // user's profile (it's type could not be determined). Autofill predicted | 345 // i.e., actual_type == T, predicted_type = U, T != U, |
| 337 // the field's type would be UNKNOWN. | 346 // UNKNOWN not in (T,U). |
| 338 TYPE_MATCH_UNKNOWN, | 347 // |
| 339 // The field was left empty, autofill predicted the user would populate it | 348 // This is captured as a type-specific log entry for T. Is is also captured |
| 340 // with autofillable data. | 349 // as an aggregate (non-type-specific) log entry. |
| 341 TYPE_MISMATCH_EMPTY, | 350 FALSE_NEGATIVE_MISMATCH, |
| 342 // The field was populated with data that did not match any part of the | 351 |
| 343 // user's profile (it's type could not be determined). Autofill predicted | 352 // The field type is EMPTY and autofill predicted UNKNOWN |
| 344 // the user would populate it with autofillable data. | 353 // i.e. actual_type == EMPTY and predicted type == UNKNOWN|NO_SERVER_DATA. |
| 345 TYPE_MISMATCH_UNKNOWN, | 354 // |
| 346 // This must be the last value. | 355 // This is captured as an aggregate (non-type-specific) log entry. It is |
| 347 NUM_FIELD_TYPE_QUALITY_METRICS, | 356 // NOT captured by type-specific logging. |
| 357 TRUE_NEGATIVE_EMPTY, | |
| 358 | |
| 359 // The field type is UNKNOWN and autofill made no prediction. | |
| 360 // i.e. actual_type == UNKNOWN and predicted type == UNKNOWN|NO_SERVER_DATA. | |
| 361 // | |
| 362 // This is captured as an aggregate (non-type-specific) log entry. It is | |
| 363 // NOT captured by type-specific logging. | |
| 364 TRUE_NEGATIVE_UNKNOWN, | |
| 365 | |
| 366 // The field type is UNKNOWN, but autofill predicted it to be of type T. | |
| 367 // i.e., actual_type == EMPTY, predicted_type = T, T != UNKNOWN | |
| 368 // | |
| 369 // This is captured as a type-specific log entry for T. Is is also captured | |
| 370 // as an aggregate (non-type-specific) log entry. | |
| 371 FALSE_POSITIVE_EMPTY, | |
| 372 | |
| 373 // The field type is UNKNOWN, but autofill predicted it to be of type T. | |
| 374 // i.e., actual_type == UNKNOWN, predicted_type = T, T != UNKNOWN | |
| 375 // | |
| 376 // This is captured as a type-specific log entry for T. Is is also captured | |
| 377 // as an aggregate (non-type-specific) log entry. | |
| 378 FALSE_POSITIVE_UNKNOWN, | |
| 379 | |
| 380 // Autofill predicted type T, but the field actually had a different type. | |
| 381 // i.e., actual_type == T, predicted_type = U, T != U, | |
| 382 // UNKNOWN not in (T,U). | |
| 383 // | |
| 384 // This is captured as a type-specific log entry for U. It is NOT captured | |
| 385 // as an aggregate (non-type-specific) entry as this would double count with | |
| 386 // FALSE_NEGATIVE_MISMATCH logging catured for T. | |
| 387 FALSE_POSITIVE_MISMATCH, | |
| 388 | |
| 389 // This must be last. | |
| 390 NUM_FIELD_TYPE_QUALITY_METRICS | |
| 348 }; | 391 }; |
| 349 | 392 |
| 350 enum QualityMetricType { | 393 enum QualityMetricType { |
| 351 TYPE_SUBMISSION = 0, // Logged based on user's submitted data. | 394 TYPE_SUBMISSION = 0, // Logged based on user's submitted data. |
| 352 TYPE_NO_SUBMISSION, // Logged based on user's entered data. | 395 TYPE_NO_SUBMISSION, // Logged based on user's entered data. |
| 353 TYPE_AUTOCOMPLETE_BASED, // Logged based on the value of autocomplete attr. | 396 TYPE_AUTOCOMPLETE_BASED, // Logged based on the value of autocomplete attr. |
| 354 NUM_QUALITY_METRIC_TYPES, | 397 NUM_QUALITY_METRIC_TYPES, |
| 355 }; | 398 }; |
| 356 | 399 |
| 357 // Each of these is logged at most once per query to the server, which in turn | 400 // Each of these is logged at most once per query to the server, which in turn |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 667 | 710 |
| 668 // Should be called when credit card scan is finished. |duration| should be | 711 // Should be called when credit card scan is finished. |duration| should be |
| 669 // the time elapsed between launching the credit card scanner and getting back | 712 // the time elapsed between launching the credit card scanner and getting back |
| 670 // the result. |completed| should be true if a credit card was scanned, false | 713 // the result. |completed| should be true if a credit card was scanned, false |
| 671 // if the scan was cancelled. | 714 // if the scan was cancelled. |
| 672 static void LogScanCreditCardCompleted(const base::TimeDelta& duration, | 715 static void LogScanCreditCardCompleted(const base::TimeDelta& duration, |
| 673 bool completed); | 716 bool completed); |
| 674 | 717 |
| 675 static void LogDeveloperEngagementMetric(DeveloperEngagementMetric metric); | 718 static void LogDeveloperEngagementMetric(DeveloperEngagementMetric metric); |
| 676 | 719 |
| 677 static void LogHeuristicTypePrediction(FieldTypeQualityMetric metric, | 720 static void LogHeuristicTypePrediction(ServerFieldTypeSet possible_types, |
| 678 ServerFieldType field_type, | 721 ServerFieldType predicted_type, |
| 679 QualityMetricType metric_type); | 722 QualityMetricType metric_type); |
| 680 static void LogOverallTypePrediction(FieldTypeQualityMetric metric, | 723 static void LogOverallTypePrediction(ServerFieldTypeSet possible_types, |
| 681 ServerFieldType field_type, | 724 ServerFieldType predicted_type, |
| 682 QualityMetricType metric_type); | 725 QualityMetricType metric_type); |
| 683 static void LogServerTypePrediction(FieldTypeQualityMetric metric, | 726 static void LogServerTypePrediction(ServerFieldTypeSet possible_types, |
| 684 ServerFieldType field_type, | 727 ServerFieldType predicted_type, |
| 685 QualityMetricType metric_type); | 728 QualityMetricType metric_type); |
| 686 | 729 |
| 687 static void LogServerQueryMetric(ServerQueryMetric metric); | 730 static void LogServerQueryMetric(ServerQueryMetric metric); |
| 688 | 731 |
| 689 static void LogUserHappinessMetric(UserHappinessMetric metric); | 732 static void LogUserHappinessMetric(UserHappinessMetric metric); |
| 690 | 733 |
| 691 // Logs |event| to the unmask prompt events histogram. | 734 // Logs |event| to the unmask prompt events histogram. |
| 692 static void LogUnmaskPromptEvent(UnmaskPromptEvent event); | 735 static void LogUnmaskPromptEvent(UnmaskPromptEvent event); |
| 693 | 736 |
| 694 // Logs the time elapsed between the unmask prompt being shown and it | 737 // Logs the time elapsed between the unmask prompt being shown and it |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 898 | 941 |
| 899 private: | 942 private: |
| 900 static const int kNumCardUploadDecisionMetrics = 12; | 943 static const int kNumCardUploadDecisionMetrics = 12; |
| 901 | 944 |
| 902 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); | 945 DISALLOW_IMPLICIT_CONSTRUCTORS(AutofillMetrics); |
| 903 }; | 946 }; |
| 904 | 947 |
| 905 } // namespace autofill | 948 } // namespace autofill |
| 906 | 949 |
| 907 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ | 950 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_METRICS_H_ |
| OLD | NEW |