OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/autofill/autofill_metrics.h" | 5 #include "chrome/browser/autofill/autofill_metrics.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "chrome/browser/autofill/autofill_type.h" | 9 #include "chrome/browser/autofill/autofill_type.h" |
10 #include "chrome/browser/autofill/form_structure.h" | 10 #include "chrome/browser/autofill/form_structure.h" |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 LogUMAHistogramEnumeration(histogram_name, metric, NUM_QUALITY_METRICS); | 281 LogUMAHistogramEnumeration(histogram_name, metric, NUM_QUALITY_METRICS); |
282 } | 282 } |
283 | 283 |
284 void AutofillMetrics::LogServerQueryMetric(ServerQueryMetric metric) const { | 284 void AutofillMetrics::LogServerQueryMetric(ServerQueryMetric metric) const { |
285 DCHECK(metric < NUM_SERVER_QUERY_METRICS); | 285 DCHECK(metric < NUM_SERVER_QUERY_METRICS); |
286 | 286 |
287 UMA_HISTOGRAM_ENUMERATION("Autofill.ServerQueryResponse", metric, | 287 UMA_HISTOGRAM_ENUMERATION("Autofill.ServerQueryResponse", metric, |
288 NUM_SERVER_QUERY_METRICS); | 288 NUM_SERVER_QUERY_METRICS); |
289 } | 289 } |
290 | 290 |
| 291 void AutofillMetrics::LogUserHappinessMetric(UserHappinessMetric metric) const { |
| 292 DCHECK(metric < NUM_USER_HAPPINESS_METRICS); |
| 293 |
| 294 // TODO(isherman): Useful for manual testing, but should be removed prior to |
| 295 // committing. |
| 296 switch (metric) { |
| 297 case FORMS_LOADED: |
| 298 DLOG(WARNING) << "LogUserHappinessMetric(FORMS_LOADED)"; |
| 299 break; |
| 300 case FORM_SUBMITTED_WITHOUT_AUTOFILL: |
| 301 DLOG(WARNING) << "LogUserHappinessMetric(FORM_SUBMITTED_WITHOUT_AUTOFILL)"
; |
| 302 break; |
| 303 case FORM_SUBMITTED_AFTER_AUTOFILL: |
| 304 DLOG(WARNING) << "LogUserHappinessMetric(FORM_SUBMITTED_AFTER_AUTOFILL)"; |
| 305 break; |
| 306 case USER_DID_TYPE: |
| 307 DLOG(WARNING) << "LogUserHappinessMetric(USER_DID_TYPE)"; |
| 308 break; |
| 309 case SUBMITTED_FORM_COULD_HAVE_BEEN_AUTOFILLED: |
| 310 DLOG(WARNING) << "LogUserHappinessMetric(SUBMITTED_FORM_COULD_HAVE_BEEN_AU
TOFILLED)"; |
| 311 break; |
| 312 case SUGGESTIONS_SHOWN: |
| 313 DLOG(WARNING) << "LogUserHappinessMetric(SUGGESTIONS_SHOWN)"; |
| 314 break; |
| 315 case SUGGESTIONS_SHOWN_FIRST_TIME: |
| 316 DLOG(WARNING) << "LogUserHappinessMetric(SUGGESTIONS_SHOWN_FIRST_TIME)"; |
| 317 break; |
| 318 case USER_DID_AUTOFILL: |
| 319 DLOG(WARNING) << "LogUserHappinessMetric(USER_DID_AUTOFILL)"; |
| 320 break; |
| 321 case USER_DID_AUTOFILL_FIRST_TIME: |
| 322 DLOG(WARNING) << "LogUserHappinessMetric(USER_DID_AUTOFILL_FIRST_TIME)"; |
| 323 break; |
| 324 case USER_DID_EDIT_AUTOFILLED_FIELD: |
| 325 DLOG(WARNING) << "LogUserHappinessMetric(USER_DID_EDIT_AUTOFILLED_FIELD)"; |
| 326 break; |
| 327 default: |
| 328 DLOG(WARNING) << "I have no idea what you're talking about."; |
| 329 } |
| 330 |
| 331 UMA_HISTOGRAM_ENUMERATION("Autofill.UserHappiness", metric, |
| 332 NUM_USER_HAPPINESS_METRICS); |
| 333 } |
| 334 |
291 void AutofillMetrics::LogIsAutofillEnabledAtStartup(bool enabled) const { | 335 void AutofillMetrics::LogIsAutofillEnabledAtStartup(bool enabled) const { |
292 UMA_HISTOGRAM_BOOLEAN("Autofill.IsEnabled.Startup", enabled); | 336 UMA_HISTOGRAM_BOOLEAN("Autofill.IsEnabled.Startup", enabled); |
293 } | 337 } |
294 | 338 |
295 void AutofillMetrics::LogIsAutofillEnabledAtPageLoad(bool enabled) const { | 339 void AutofillMetrics::LogIsAutofillEnabledAtPageLoad(bool enabled) const { |
296 UMA_HISTOGRAM_BOOLEAN("Autofill.IsEnabled.PageLoad", enabled); | 340 UMA_HISTOGRAM_BOOLEAN("Autofill.IsEnabled.PageLoad", enabled); |
297 } | 341 } |
298 | 342 |
299 void AutofillMetrics::LogStoredProfileCount(size_t num_profiles) const { | 343 void AutofillMetrics::LogStoredProfileCount(size_t num_profiles) const { |
300 UMA_HISTOGRAM_COUNTS("Autofill.StoredProfileCount", num_profiles); | 344 UMA_HISTOGRAM_COUNTS("Autofill.StoredProfileCount", num_profiles); |
301 } | 345 } |
302 | 346 |
303 void AutofillMetrics::LogAddressSuggestionsCount(size_t num_suggestions) const { | 347 void AutofillMetrics::LogAddressSuggestionsCount(size_t num_suggestions) const { |
304 UMA_HISTOGRAM_COUNTS("Autofill.AddressSuggestionsCount", num_suggestions); | 348 UMA_HISTOGRAM_COUNTS("Autofill.AddressSuggestionsCount", num_suggestions); |
305 } | 349 } |
306 | 350 |
307 void AutofillMetrics::LogServerExperimentIdForQuery( | 351 void AutofillMetrics::LogServerExperimentIdForQuery( |
308 const std::string& experiment_id) const { | 352 const std::string& experiment_id) const { |
309 LogServerExperimentId("Autofill.ServerExperimentId.Query", experiment_id); | 353 LogServerExperimentId("Autofill.ServerExperimentId.Query", experiment_id); |
310 } | 354 } |
311 | 355 |
312 void AutofillMetrics::LogServerExperimentIdForUpload( | 356 void AutofillMetrics::LogServerExperimentIdForUpload( |
313 const std::string& experiment_id) const { | 357 const std::string& experiment_id) const { |
314 LogServerExperimentId("Autofill.ServerExperimentId.Upload", experiment_id); | 358 LogServerExperimentId("Autofill.ServerExperimentId.Upload", experiment_id); |
315 } | 359 } |
OLD | NEW |