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 "base/md5.h" | 7 #include "base/md5.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 | 9 |
10 SpellCheckHostMetrics::SpellCheckHostMetrics() | 10 SpellCheckHostMetrics::SpellCheckHostMetrics() |
11 : misspelled_word_count_(0), | 11 : misspelled_word_count_(0), |
12 spellchecked_word_count_(0), | 12 spellchecked_word_count_(0), |
13 suggestion_show_count_(0), | 13 suggestion_show_count_(0), |
14 replaced_word_count_(0), | 14 replaced_word_count_(0), |
15 start_time_(base::Time::Now()) { | 15 start_time_(base::Time::Now()) { |
16 const uint64 kHistogramTimerDurationInMinutes = 30; | 16 const uint64 kHistogramTimerDurationInMinutes = 30; |
17 recording_timer_.Start(FROM_HERE, | 17 recording_timer_.Start( |
18 base::TimeDelta::FromMinutes(kHistogramTimerDurationInMinutes), | 18 base::TimeDelta::FromMinutes(kHistogramTimerDurationInMinutes), |
19 this, &SpellCheckHostMetrics::OnHistogramTimerExpired); | 19 this, &SpellCheckHostMetrics::OnHistogramTimerExpired); |
20 RecordWordCounts(); | 20 RecordWordCounts(); |
21 } | 21 } |
22 | 22 |
23 SpellCheckHostMetrics::~SpellCheckHostMetrics() { | 23 SpellCheckHostMetrics::~SpellCheckHostMetrics() { |
24 } | 24 } |
25 | 25 |
26 void SpellCheckHostMetrics::RecordCustomWordCountStats(size_t count) { | 26 void SpellCheckHostMetrics::RecordCustomWordCountStats(size_t count) { |
27 UMA_HISTOGRAM_COUNTS("SpellCheck.CustomWords", count); | 27 UMA_HISTOGRAM_COUNTS("SpellCheck.CustomWords", count); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 RecordWordCounts(); | 101 RecordWordCounts(); |
102 } | 102 } |
103 | 103 |
104 void SpellCheckHostMetrics::RecordWordCounts() { | 104 void SpellCheckHostMetrics::RecordWordCounts() { |
105 UMA_HISTOGRAM_COUNTS("SpellCheck.CheckedWords", spellchecked_word_count_); | 105 UMA_HISTOGRAM_COUNTS("SpellCheck.CheckedWords", spellchecked_word_count_); |
106 UMA_HISTOGRAM_COUNTS("SpellCheck.MisspelledWords", misspelled_word_count_); | 106 UMA_HISTOGRAM_COUNTS("SpellCheck.MisspelledWords", misspelled_word_count_); |
107 UMA_HISTOGRAM_COUNTS("SpellCheck.ReplacedWords", replaced_word_count_); | 107 UMA_HISTOGRAM_COUNTS("SpellCheck.ReplacedWords", replaced_word_count_); |
108 UMA_HISTOGRAM_COUNTS("SpellCheck.UniqueWords", checked_word_hashes_.size()); | 108 UMA_HISTOGRAM_COUNTS("SpellCheck.UniqueWords", checked_word_hashes_.size()); |
109 UMA_HISTOGRAM_COUNTS("SpellCheck.ShownSuggestions", suggestion_show_count_); | 109 UMA_HISTOGRAM_COUNTS("SpellCheck.ShownSuggestions", suggestion_show_count_); |
110 } | 110 } |
OLD | NEW |