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

Unified Diff: content/gpu/gpu_info_collector_win.cc

Issue 10832278: Fix WinSAT histograms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initial commit. Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/gpu/gpu_info_collector_win.cc
diff --git a/content/gpu/gpu_info_collector_win.cc b/content/gpu/gpu_info_collector_win.cc
index 4843865e930d003ea0939b46b3826679f1f45a39..7891415955cbd268cda350880f7cfe81589c7c4f 100644
--- a/content/gpu/gpu_info_collector_win.cc
+++ b/content/gpu/gpu_info_collector_win.cc
@@ -58,8 +58,6 @@ content::GpuPerformanceStats RetrieveGpuPerformanceStats() {
// http://crbug.com/124325, read the assessment result files directly.
content::GpuPerformanceStats stats;
- base::TimeTicks start_time = base::TimeTicks::Now();
-
// Get path to WinSAT results files.
wchar_t winsat_results_path[MAX_PATH];
DWORD size = ExpandEnvironmentStrings(
@@ -136,15 +134,25 @@ content::GpuPerformanceStats RetrieveGpuPerformanceStats() {
if (stats.gaming == 0.0)
LOG(ERROR) << "Could not read gaming score from assessment results.";
+ return stats;
+}
+
+content::GpuPerformanceStats RetrieveGpuPerformanceStatsWithHistograms() {
+ base::TimeTicks start_time = base::TimeTicks::Now();
+
+ content::GpuPerformanceStats stats = RetrieveGpuPerformanceStats();
+
+ UMA_HISTOGRAM_TIMES("GPU.WinSAT.ReadResultsFileTime",
+ base::TimeTicks::Now() - start_time);
UMA_HISTOGRAM_CUSTOM_COUNTS("GPU.WinSAT.OverallScore2",
stats.overall * 10, 10, 200, 50);
UMA_HISTOGRAM_CUSTOM_COUNTS("GPU.WinSAT.GraphicsScore2",
stats.graphics * 10, 10, 200, 50);
UMA_HISTOGRAM_CUSTOM_COUNTS("GPU.WinSAT.GamingScore2",
stats.gaming * 10, 10, 200, 50);
-
- UMA_HISTOGRAM_TIMES("GPU.WinSAT.ReadResultsFileTime",
- base::TimeTicks::Now() - start_time);
+ UMA_HISTOGRAM_BOOLEAN(
+ "GPU.WinSAT.HasResults",
+ stats.overall != 0.0 && stats.graphics != 0.0 && stats.gaming != 0.0);
return stats;
}
@@ -168,11 +176,7 @@ bool CollectGraphicsInfo(content::GPUInfo* gpu_info) {
DCHECK(gpu_info);
- content::GpuPerformanceStats stats = RetrieveGpuPerformanceStats();
- UMA_HISTOGRAM_BOOLEAN(
- "GPU.WinSAT.HasResults",
- stats.overall != 0.0 && stats.graphics != 0.0 && stats.gaming != 0.0);
- gpu_info->performance_stats = stats;
+ gpu_info->performance_stats = RetrieveGpuPerformanceStats();
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) {
std::string requested_implementation_name =
@@ -227,7 +231,7 @@ bool CollectPreliminaryGraphicsInfo(content::GPUInfo* gpu_info) {
if (!CollectVideoCardInfo(gpu_info))
rt = false;
- gpu_info->performance_stats = RetrieveGpuPerformanceStats();
+ gpu_info->performance_stats = RetrieveGpuPerformanceStatsWithHistograms();
return rt;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698