| 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/spellchecker/spellcheck_host_metrics.h" | 5 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include "base/md5.h" | 9 #include "base/md5.h" |
| 8 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 9 | 11 |
| 10 SpellCheckHostMetrics::SpellCheckHostMetrics() | 12 SpellCheckHostMetrics::SpellCheckHostMetrics() |
| 11 : misspelled_word_count_(0), | 13 : misspelled_word_count_(0), |
| 12 last_misspelled_word_count_(-1), | 14 last_misspelled_word_count_(-1), |
| 13 spellchecked_word_count_(0), | 15 spellchecked_word_count_(0), |
| 14 last_spellchecked_word_count_(-1), | 16 last_spellchecked_word_count_(-1), |
| 15 suggestion_show_count_(0), | 17 suggestion_show_count_(0), |
| 16 last_suggestion_show_count_(-1), | 18 last_suggestion_show_count_(-1), |
| 17 replaced_word_count_(0), | 19 replaced_word_count_(0), |
| 18 last_replaced_word_count_(-1), | 20 last_replaced_word_count_(-1), |
| 19 last_unique_word_count_(-1), | 21 last_unique_word_count_(-1), |
| 20 start_time_(base::TimeTicks::Now()) { | 22 start_time_(base::TimeTicks::Now()) { |
| 21 const uint64 kHistogramTimerDurationInMinutes = 30; | 23 const uint64_t kHistogramTimerDurationInMinutes = 30; |
| 22 recording_timer_.Start(FROM_HERE, | 24 recording_timer_.Start(FROM_HERE, |
| 23 base::TimeDelta::FromMinutes(kHistogramTimerDurationInMinutes), | 25 base::TimeDelta::FromMinutes(kHistogramTimerDurationInMinutes), |
| 24 this, &SpellCheckHostMetrics::OnHistogramTimerExpired); | 26 this, &SpellCheckHostMetrics::OnHistogramTimerExpired); |
| 25 RecordWordCounts(); | 27 RecordWordCounts(); |
| 26 } | 28 } |
| 27 | 29 |
| 28 SpellCheckHostMetrics::~SpellCheckHostMetrics() { | 30 SpellCheckHostMetrics::~SpellCheckHostMetrics() { |
| 29 } | 31 } |
| 30 | 32 |
| 31 // static | 33 // static |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 if (suggestion_show_count_ != last_suggestion_show_count_) { | 140 if (suggestion_show_count_ != last_suggestion_show_count_) { |
| 139 DCHECK(suggestion_show_count_ > last_suggestion_show_count_); | 141 DCHECK(suggestion_show_count_ > last_suggestion_show_count_); |
| 140 UMA_HISTOGRAM_COUNTS("SpellCheck.ShownSuggestions", suggestion_show_count_); | 142 UMA_HISTOGRAM_COUNTS("SpellCheck.ShownSuggestions", suggestion_show_count_); |
| 141 last_suggestion_show_count_ = suggestion_show_count_; | 143 last_suggestion_show_count_ = suggestion_show_count_; |
| 142 } | 144 } |
| 143 } | 145 } |
| 144 | 146 |
| 145 void SpellCheckHostMetrics::RecordSpellingServiceStats(bool enabled) { | 147 void SpellCheckHostMetrics::RecordSpellingServiceStats(bool enabled) { |
| 146 UMA_HISTOGRAM_BOOLEAN("SpellCheck.SpellingService.Enabled", enabled); | 148 UMA_HISTOGRAM_BOOLEAN("SpellCheck.SpellingService.Enabled", enabled); |
| 147 } | 149 } |
| OLD | NEW |