Chromium Code Reviews| 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 "base/time.h" | |
| 9 #include "chrome/browser/autofill/autofill_type.h" | 10 #include "chrome/browser/autofill/autofill_type.h" |
| 10 #include "chrome/browser/autofill/form_structure.h" | 11 #include "chrome/browser/autofill/form_structure.h" |
| 11 #include "webkit/glue/form_data.h" | 12 #include "webkit/glue/form_data.h" |
| 12 | 13 |
| 13 namespace { | 14 namespace { |
| 14 | 15 |
| 15 // Server experiments we support. | 16 // Server experiments we support. |
| 16 enum ServerExperiment { | 17 enum ServerExperiment { |
| 17 NO_EXPERIMENT = 0, | 18 NO_EXPERIMENT = 0, |
| 18 UNKNOWN_EXPERIMENT, | 19 UNKNOWN_EXPERIMENT, |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 291 NUM_SERVER_QUERY_METRICS); | 292 NUM_SERVER_QUERY_METRICS); |
| 292 } | 293 } |
| 293 | 294 |
| 294 void AutofillMetrics::LogUserHappinessMetric(UserHappinessMetric metric) const { | 295 void AutofillMetrics::LogUserHappinessMetric(UserHappinessMetric metric) const { |
| 295 DCHECK(metric < NUM_USER_HAPPINESS_METRICS); | 296 DCHECK(metric < NUM_USER_HAPPINESS_METRICS); |
| 296 | 297 |
| 297 UMA_HISTOGRAM_ENUMERATION("Autofill.UserHappiness", metric, | 298 UMA_HISTOGRAM_ENUMERATION("Autofill.UserHappiness", metric, |
| 298 NUM_USER_HAPPINESS_METRICS); | 299 NUM_USER_HAPPINESS_METRICS); |
| 299 } | 300 } |
| 300 | 301 |
| 302 void AutofillMetrics::LogFormFillDurationFromLoadWithAutofill( | |
| 303 const base::TimeDelta& duration) const { | |
| 304 UMA_HISTOGRAM_TIMES("Autofill.FillDuration.FromLoad.WithAutofill", duration); | |
| 305 } | |
| 306 | |
| 307 void AutofillMetrics::LogFormFillDurationFromLoadWithoutAutofill( | |
| 308 const base::TimeDelta& duration) const { | |
| 309 UMA_HISTOGRAM_TIMES("Autofill.FillDuration.FromLoad.WithoutAutofill", | |
| 310 duration); | |
| 311 } | |
| 312 | |
| 313 void AutofillMetrics::LogFormFillDurationFromInteractionWithAutofill( | |
| 314 const base::TimeDelta& duration) const { | |
| 315 UMA_HISTOGRAM_TIMES("Autofill.FillDuration.FromInteraction.WithAutofill", | |
|
jar (doing other things)
2011/09/02 01:48:33
What is the dynamic range you're expecting for thi
Ilya Sherman
2011/09/02 06:57:54
Oh, wow, good catch! I think 100ms to 10 minutes
jar (doing other things)
2011/09/02 20:09:26
Your change to 100ms through 10 minutes looks grea
| |
| 316 duration); | |
| 317 } | |
| 318 | |
| 319 void AutofillMetrics::LogFormFillDurationFromInteractionWithoutAutofill( | |
| 320 const base::TimeDelta& duration) const { | |
| 321 UMA_HISTOGRAM_TIMES("Autofill.FormFillTime.FromInteraction.WithoutAutofill", | |
| 322 duration); | |
| 323 } | |
| 324 | |
| 301 void AutofillMetrics::LogIsAutofillEnabledAtStartup(bool enabled) const { | 325 void AutofillMetrics::LogIsAutofillEnabledAtStartup(bool enabled) const { |
| 302 UMA_HISTOGRAM_BOOLEAN("Autofill.IsEnabled.Startup", enabled); | 326 UMA_HISTOGRAM_BOOLEAN("Autofill.IsEnabled.Startup", enabled); |
| 303 } | 327 } |
| 304 | 328 |
| 305 void AutofillMetrics::LogIsAutofillEnabledAtPageLoad(bool enabled) const { | 329 void AutofillMetrics::LogIsAutofillEnabledAtPageLoad(bool enabled) const { |
| 306 UMA_HISTOGRAM_BOOLEAN("Autofill.IsEnabled.PageLoad", enabled); | 330 UMA_HISTOGRAM_BOOLEAN("Autofill.IsEnabled.PageLoad", enabled); |
| 307 } | 331 } |
| 308 | 332 |
| 309 void AutofillMetrics::LogStoredProfileCount(size_t num_profiles) const { | 333 void AutofillMetrics::LogStoredProfileCount(size_t num_profiles) const { |
| 310 UMA_HISTOGRAM_COUNTS("Autofill.StoredProfileCount", num_profiles); | 334 UMA_HISTOGRAM_COUNTS("Autofill.StoredProfileCount", num_profiles); |
| 311 } | 335 } |
| 312 | 336 |
| 313 void AutofillMetrics::LogAddressSuggestionsCount(size_t num_suggestions) const { | 337 void AutofillMetrics::LogAddressSuggestionsCount(size_t num_suggestions) const { |
| 314 UMA_HISTOGRAM_COUNTS("Autofill.AddressSuggestionsCount", num_suggestions); | 338 UMA_HISTOGRAM_COUNTS("Autofill.AddressSuggestionsCount", num_suggestions); |
| 315 } | 339 } |
| 316 | 340 |
| 317 void AutofillMetrics::LogServerExperimentIdForQuery( | 341 void AutofillMetrics::LogServerExperimentIdForQuery( |
| 318 const std::string& experiment_id) const { | 342 const std::string& experiment_id) const { |
| 319 LogServerExperimentId("Autofill.ServerExperimentId.Query", experiment_id); | 343 LogServerExperimentId("Autofill.ServerExperimentId.Query", experiment_id); |
| 320 } | 344 } |
| 321 | 345 |
| 322 void AutofillMetrics::LogServerExperimentIdForUpload( | 346 void AutofillMetrics::LogServerExperimentIdForUpload( |
| 323 const std::string& experiment_id) const { | 347 const std::string& experiment_id) const { |
| 324 LogServerExperimentId("Autofill.ServerExperimentId.Upload", experiment_id); | 348 LogServerExperimentId("Autofill.ServerExperimentId.Upload", experiment_id); |
| 325 } | 349 } |
| OLD | NEW |