| 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 #include "components/autofill/core/browser/autofill_metrics.h" | 5 #include "components/autofill/core/browser/autofill_metrics.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 void AutofillMetrics::LogDetermineHeuristicTypesTiming( | 587 void AutofillMetrics::LogDetermineHeuristicTypesTiming( |
| 588 const base::TimeDelta& duration) { | 588 const base::TimeDelta& duration) { |
| 589 UMA_HISTOGRAM_TIMES("Autofill.Timing.DetermineHeuristicTypes", duration); | 589 UMA_HISTOGRAM_TIMES("Autofill.Timing.DetermineHeuristicTypes", duration); |
| 590 } | 590 } |
| 591 | 591 |
| 592 // static | 592 // static |
| 593 void AutofillMetrics::LogParseFormTiming(const base::TimeDelta& duration) { | 593 void AutofillMetrics::LogParseFormTiming(const base::TimeDelta& duration) { |
| 594 UMA_HISTOGRAM_TIMES("Autofill.Timing.ParseForm", duration); | 594 UMA_HISTOGRAM_TIMES("Autofill.Timing.ParseForm", duration); |
| 595 } | 595 } |
| 596 | 596 |
| 597 // static |
| 598 void AutofillMetrics::LogNumberOfProfilesConsideredForDedupe( |
| 599 size_t num_considered) { |
| 600 // A maximum of 50 is enforced to reduce the number of generated buckets. |
| 601 UMA_HISTOGRAM_COUNTS_1000("Autofill.NumberOfProfilesConsideredForDedupe", |
| 602 std::min(int(num_considered), 50)); |
| 603 } |
| 604 |
| 605 // static |
| 606 void AutofillMetrics::LogNumberOfProfilesRemovedDuringDedupe( |
| 607 size_t num_removed) { |
| 608 // A maximum of 50 is enforced to reduce the number of generated buckets. |
| 609 UMA_HISTOGRAM_COUNTS_1000("Autofill.NumberOfProfilesRemovedDuringDedupe", |
| 610 std::min(int(num_removed), 50)); |
| 611 } |
| 612 |
| 597 AutofillMetrics::FormEventLogger::FormEventLogger(bool is_for_credit_card) | 613 AutofillMetrics::FormEventLogger::FormEventLogger(bool is_for_credit_card) |
| 598 : is_for_credit_card_(is_for_credit_card), | 614 : is_for_credit_card_(is_for_credit_card), |
| 599 is_server_data_available_(false), | 615 is_server_data_available_(false), |
| 600 is_local_data_available_(false), | 616 is_local_data_available_(false), |
| 601 has_logged_interacted_(false), | 617 has_logged_interacted_(false), |
| 602 has_logged_suggestions_shown_(false), | 618 has_logged_suggestions_shown_(false), |
| 603 has_logged_masked_server_card_suggestion_selected_(false), | 619 has_logged_masked_server_card_suggestion_selected_(false), |
| 604 has_logged_suggestion_filled_(false), | 620 has_logged_suggestion_filled_(false), |
| 605 has_logged_will_submit_(false), | 621 has_logged_will_submit_(false), |
| 606 has_logged_submitted_(false), | 622 has_logged_submitted_(false), |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 else if (is_server_data_available_ && !is_local_data_available_) | 784 else if (is_server_data_available_ && !is_local_data_available_) |
| 769 name += ".WithOnlyServerData"; | 785 name += ".WithOnlyServerData"; |
| 770 else if (!is_server_data_available_ && is_local_data_available_) | 786 else if (!is_server_data_available_ && is_local_data_available_) |
| 771 name += ".WithOnlyLocalData"; | 787 name += ".WithOnlyLocalData"; |
| 772 else | 788 else |
| 773 name += ".WithBothServerAndLocalData"; | 789 name += ".WithBothServerAndLocalData"; |
| 774 LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS); | 790 LogUMAHistogramEnumeration(name, event, NUM_FORM_EVENTS); |
| 775 } | 791 } |
| 776 | 792 |
| 777 } // namespace autofill | 793 } // namespace autofill |
| OLD | NEW |