Commit 6b31ef19 authored by dtu@chromium.org's avatar dtu@chromium.org

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
parent 511b2241
...@@ -58,8 +58,6 @@ content::GpuPerformanceStats RetrieveGpuPerformanceStats() { ...@@ -58,8 +58,6 @@ content::GpuPerformanceStats RetrieveGpuPerformanceStats() {
// http://crbug.com/124325, read the assessment result files directly. // http://crbug.com/124325, read the assessment result files directly.
content::GpuPerformanceStats stats; content::GpuPerformanceStats stats;
base::TimeTicks start_time = base::TimeTicks::Now();
// Get path to WinSAT results files. // Get path to WinSAT results files.
wchar_t winsat_results_path[MAX_PATH]; wchar_t winsat_results_path[MAX_PATH];
DWORD size = ExpandEnvironmentStrings( DWORD size = ExpandEnvironmentStrings(
...@@ -136,15 +134,25 @@ content::GpuPerformanceStats RetrieveGpuPerformanceStats() { ...@@ -136,15 +134,25 @@ content::GpuPerformanceStats RetrieveGpuPerformanceStats() {
if (stats.gaming == 0.0) if (stats.gaming == 0.0)
LOG(ERROR) << "Could not read gaming score from assessment results."; 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", UMA_HISTOGRAM_CUSTOM_COUNTS("GPU.WinSAT.OverallScore2",
stats.overall * 10, 10, 200, 50); stats.overall * 10, 10, 200, 50);
UMA_HISTOGRAM_CUSTOM_COUNTS("GPU.WinSAT.GraphicsScore2", UMA_HISTOGRAM_CUSTOM_COUNTS("GPU.WinSAT.GraphicsScore2",
stats.graphics * 10, 10, 200, 50); stats.graphics * 10, 10, 200, 50);
UMA_HISTOGRAM_CUSTOM_COUNTS("GPU.WinSAT.GamingScore2", UMA_HISTOGRAM_CUSTOM_COUNTS("GPU.WinSAT.GamingScore2",
stats.gaming * 10, 10, 200, 50); stats.gaming * 10, 10, 200, 50);
UMA_HISTOGRAM_BOOLEAN(
UMA_HISTOGRAM_TIMES("GPU.WinSAT.ReadResultsFileTime", "GPU.WinSAT.HasResults",
base::TimeTicks::Now() - start_time); stats.overall != 0.0 && stats.graphics != 0.0 && stats.gaming != 0.0);
return stats; return stats;
} }
...@@ -168,11 +176,7 @@ bool CollectGraphicsInfo(content::GPUInfo* gpu_info) { ...@@ -168,11 +176,7 @@ bool CollectGraphicsInfo(content::GPUInfo* gpu_info) {
DCHECK(gpu_info); DCHECK(gpu_info);
content::GpuPerformanceStats stats = RetrieveGpuPerformanceStats(); gpu_info->performance_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;
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) { if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL)) {
std::string requested_implementation_name = std::string requested_implementation_name =
...@@ -227,7 +231,7 @@ bool CollectPreliminaryGraphicsInfo(content::GPUInfo* gpu_info) { ...@@ -227,7 +231,7 @@ bool CollectPreliminaryGraphicsInfo(content::GPUInfo* gpu_info) {
if (!CollectVideoCardInfo(gpu_info)) if (!CollectVideoCardInfo(gpu_info))
rt = false; rt = false;
gpu_info->performance_stats = RetrieveGpuPerformanceStats(); gpu_info->performance_stats = RetrieveGpuPerformanceStatsWithHistograms();
return rt; return rt;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment