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

Side by Side Diff: components/translate/core/common/translate_metrics.cc

Issue 656363002: Type conversion fixes, components/ edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/translate/core/common/translate_metrics.h" 5 #include "components/translate/core/common/translate_metrics.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 9
10 namespace translate { 10 namespace translate {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 void ReportLanguageVerification(LanguageVerificationType type) { 76 void ReportLanguageVerification(LanguageVerificationType type) {
77 UMA_HISTOGRAM_ENUMERATION(kTranslateLanguageVerification, 77 UMA_HISTOGRAM_ENUMERATION(kTranslateLanguageVerification,
78 type, 78 type,
79 LANGUAGE_VERIFICATION_MAX); 79 LANGUAGE_VERIFICATION_MAX);
80 } 80 }
81 81
82 void ReportTimeToBeReady(double time_in_msec) { 82 void ReportTimeToBeReady(double time_in_msec) {
83 UMA_HISTOGRAM_MEDIUM_TIMES( 83 UMA_HISTOGRAM_MEDIUM_TIMES(
84 kTranslateTimeToBeReady, 84 kTranslateTimeToBeReady,
85 base::TimeDelta::FromMicroseconds(time_in_msec * 1000.0)); 85 base::TimeDelta::FromMicroseconds(
86 static_cast<int64>(time_in_msec * 1000.0)));
86 } 87 }
87 88
88 void ReportTimeToLoad(double time_in_msec) { 89 void ReportTimeToLoad(double time_in_msec) {
89 UMA_HISTOGRAM_MEDIUM_TIMES( 90 UMA_HISTOGRAM_MEDIUM_TIMES(
90 kTranslateTimeToLoad, 91 kTranslateTimeToLoad,
91 base::TimeDelta::FromMicroseconds(time_in_msec * 1000.0)); 92 base::TimeDelta::FromMicroseconds(
93 static_cast<int64>(time_in_msec * 1000.0)));
92 } 94 }
93 95
94 void ReportTimeToTranslate(double time_in_msec) { 96 void ReportTimeToTranslate(double time_in_msec) {
95 UMA_HISTOGRAM_MEDIUM_TIMES( 97 UMA_HISTOGRAM_MEDIUM_TIMES(
96 kTranslateTimeToTranslate, 98 kTranslateTimeToTranslate,
97 base::TimeDelta::FromMicroseconds(time_in_msec * 1000.0)); 99 base::TimeDelta::FromMicroseconds(
100 static_cast<int64>(time_in_msec * 1000.0)));
98 } 101 }
99 102
100 void ReportUserActionDuration(base::TimeTicks begin, base::TimeTicks end) { 103 void ReportUserActionDuration(base::TimeTicks begin, base::TimeTicks end) {
101 UMA_HISTOGRAM_LONG_TIMES(kTranslateUserActionDuration, end - begin); 104 UMA_HISTOGRAM_LONG_TIMES(kTranslateUserActionDuration, end - begin);
102 } 105 }
103 106
104 void ReportPageScheme(const std::string& scheme) { 107 void ReportPageScheme(const std::string& scheme) {
105 SchemeType type = SCHEME_OTHERS; 108 SchemeType type = SCHEME_OTHERS;
106 if (scheme == kSchemeHttp) 109 if (scheme == kSchemeHttp)
107 type = SCHEME_HTTP; 110 type = SCHEME_HTTP;
(...skipping 13 matching lines...) Expand all
121 const char* GetMetricsName(MetricsNameIndex index) { 124 const char* GetMetricsName(MetricsNameIndex index) {
122 for (size_t i = 0; i < arraysize(kMetricsEntries); ++i) { 125 for (size_t i = 0; i < arraysize(kMetricsEntries); ++i) {
123 if (kMetricsEntries[i].index == index) 126 if (kMetricsEntries[i].index == index)
124 return kMetricsEntries[i].name; 127 return kMetricsEntries[i].name;
125 } 128 }
126 NOTREACHED(); 129 NOTREACHED();
127 return NULL; 130 return NULL;
128 } 131 }
129 132
130 } // namespace translate 133 } // namespace translate
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698