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

Unified Diff: chrome/browser/metrics/drive_metrics_provider.cc

Issue 1011093004: metrics: log whether drives have seek penalties (and whether this was determined successfully). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ssd2
Patch Set: times Created 5 years, 9 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 | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/drive_metrics_provider.cc
diff --git a/chrome/browser/metrics/drive_metrics_provider.cc b/chrome/browser/metrics/drive_metrics_provider.cc
index f2e2ac51cdcae22e8985d81d93fcb14ed2f6759d..50c6270e6f4bb1fc2f9c420f18b631cf82bc1829 100644
--- a/chrome/browser/metrics/drive_metrics_provider.cc
+++ b/chrome/browser/metrics/drive_metrics_provider.cc
@@ -9,8 +9,10 @@
#include "base/files/file_path.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/metrics/histogram_macros.h"
#include "base/path_service.h"
#include "base/sys_info.h"
+#include "base/time/time.h"
#include "chrome/common/chrome_paths.h"
#include "content/public/browser/browser_thread.h"
@@ -60,8 +62,19 @@ void DriveMetricsProvider::QuerySeekPenalty(
if (!PathService::Get(path_service_key, &path))
return;
+ base::TimeTicks start = base::TimeTicks::Now();
+
response->success =
base::SysInfo::HasSeekPenalty(path, &response->has_seek_penalty);
+
+ UMA_HISTOGRAM_TIMES("Hardware.Drive.HasSeekPenalty_Time",
+ base::TimeTicks::Now() - start);
+ UMA_HISTOGRAM_BOOLEAN("Hardware.Drive.HasSeekPenalty_Success",
+ response->success);
+ if (response->success) {
+ UMA_HISTOGRAM_BOOLEAN("Hardware.Drive.HasSeekPenalty",
+ response->has_seek_penalty);
+ }
}
void DriveMetricsProvider::GotDriveMetrics(
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698