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

Unified Diff: components/autofill/core/browser/autofill_metrics.cc

Issue 2003563003: [Autofill] Quality metric based on autocomplete attributes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: histograms.xml Created 4 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/autofill_metrics.cc
diff --git a/components/autofill/core/browser/autofill_metrics.cc b/components/autofill/core/browser/autofill_metrics.cc
index afafd3d59ae6c4491d9a94fd4b6780ede645eb02..67a2fc7a4600b66bbb671a9d23ba703872dd381c 100644
--- a/components/autofill/core/browser/autofill_metrics.cc
+++ b/components/autofill/core/browser/autofill_metrics.cc
@@ -214,14 +214,27 @@ void LogUMAHistogramLongTimes(const std::string& name,
// Logs a type quality metric. The primary histogram name is constructed based
// on |base_name|. The field-specific histogram name also factors in the
// |field_type|. Logs a sample of |metric|, which should be in the range
-// [0, |num_possible_metrics|).
+// [0, |num_possible_metrics|). May log a suffixed version of the metric
+// depending on |metric_type|.
void LogTypeQualityMetric(const std::string& base_name,
AutofillMetrics::FieldTypeQualityMetric metric,
ServerFieldType field_type,
- bool observed_submission) {
+ AutofillMetrics::QualityMetricType metric_type) {
DCHECK_LT(metric, AutofillMetrics::NUM_FIELD_TYPE_QUALITY_METRICS);
- const std::string suffix(observed_submission ? "" : ".NoSubmission");
+ std::string suffix;
+ switch (metric_type) {
+ case AutofillMetrics::TYPE_SUBMISSION:
+ break;
+ case AutofillMetrics::TYPE_NO_SUBMISSION:
+ suffix = ".NoSubmission";
+ break;
+ case AutofillMetrics::TYPE_AUTOCOMPLETE_BASED:
+ suffix = ".BasedOnAutocomplete";
+ break;
+ default:
+ NOTREACHED();
+ }
LogUMAHistogramEnumeration(base_name + suffix, metric,
AutofillMetrics::NUM_FIELD_TYPE_QUALITY_METRICS);
@@ -408,27 +421,28 @@ void AutofillMetrics::LogDeveloperEngagementMetric(
}
// static
-void AutofillMetrics::LogHeuristicTypePrediction(FieldTypeQualityMetric metric,
- ServerFieldType field_type,
- bool observed_submission) {
+void AutofillMetrics::LogHeuristicTypePrediction(
+ FieldTypeQualityMetric metric,
+ ServerFieldType field_type,
+ QualityMetricType metric_type) {
LogTypeQualityMetric("Autofill.Quality.HeuristicType", metric, field_type,
- observed_submission);
+ metric_type);
}
// static
void AutofillMetrics::LogOverallTypePrediction(FieldTypeQualityMetric metric,
ServerFieldType field_type,
- bool observed_submission) {
+ QualityMetricType metric_type) {
LogTypeQualityMetric("Autofill.Quality.PredictedType", metric, field_type,
- observed_submission);
+ metric_type);
}
// static
void AutofillMetrics::LogServerTypePrediction(FieldTypeQualityMetric metric,
ServerFieldType field_type,
- bool observed_submission) {
+ QualityMetricType metric_type) {
LogTypeQualityMetric("Autofill.Quality.ServerType", metric, field_type,
- observed_submission);
+ metric_type);
}
// static
« no previous file with comments | « components/autofill/core/browser/autofill_metrics.h ('k') | components/autofill/core/browser/autofill_metrics_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698