summaryrefslogtreecommitdiffstats
path: root/content/gpu
diff options
context:
space:
mode:
authordtu@chromium.org <dtu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-17 02:34:21 +0000
committerdtu@chromium.org <dtu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-17 02:34:21 +0000
commit6b31ef19f587db7e03da0535ebf0398c6e3f4f3c (patch)
treefde51271cdba8e0fa1c6fa4dd9b2e1de01fdc135 /content/gpu
parent511b22412568be95c9a42e1d52917606515943d3 (diff)
downloadchromium_src-6b31ef19f587db7e03da0535ebf0398c6e3f4f3c.zip
chromium_src-6b31ef19f587db7e03da0535ebf0398c6e3f4f3c.tar.gz
chromium_src-6b31ef19f587db7e03da0535ebf0398c6e3f4f3c.tar.bz2
Fix WinSAT histograms.
Make sure WinSAT.HasResults runs when the preliminary graphics info is collected on startup. Move the individual score histograms to include all the error cases. BUG=None. Review URL: https://chromiumcodereview.appspot.com/10832278 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152024 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/gpu')
-rw-r--r--content/gpu/gpu_info_collector_win.cc26
1 files changed, 15 insertions, 11 deletions
diff --git a/content/gpu/gpu_info_collector_win.cc b/content/gpu/gpu_info_collector_win.cc
index 4843865..7891415 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;
}