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

Unified Diff: net/disk_cache/simple/simple_synchronous_entry.cc

Issue 1134353003: Add UMA for disk latency for cache accesses. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@AddUMA
Patch Set: Switched to ElapsedTimer. Created 5 years, 7 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') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_synchronous_entry.cc
diff --git a/net/disk_cache/simple/simple_synchronous_entry.cc b/net/disk_cache/simple/simple_synchronous_entry.cc
index f85910550ee2e3836d01e07d0df001b1d2c9928b..542cedef84c8f78862a084e7a0fd72c1c6f0de02 100644
--- a/net/disk_cache/simple/simple_synchronous_entry.cc
+++ b/net/disk_cache/simple/simple_synchronous_entry.cc
@@ -14,9 +14,11 @@
#include "base/files/file_util.h"
#include "base/hash.h"
#include "base/location.h"
+#include "base/metrics/histogram.h"
#include "base/numerics/safe_conversions.h"
#include "base/sha1.h"
#include "base/strings/stringprintf.h"
+#include "base/timer/elapsed_timer.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/disk_cache/simple/simple_backend_version.h"
@@ -216,6 +218,7 @@ void SimpleSynchronousEntry::OpenEntry(
const uint64 entry_hash,
bool had_index,
SimpleEntryCreationResults *out_results) {
+ base::ElapsedTimer open_time;
SimpleSynchronousEntry* sync_entry =
new SimpleSynchronousEntry(cache_type, path, "", entry_hash);
out_results->result =
@@ -230,6 +233,7 @@ void SimpleSynchronousEntry::OpenEntry(
out_results->stream_0_data = NULL;
return;
}
+ UMA_HISTOGRAM_TIMES("SimpleCache.DiskOpenLatency", open_time.Elapsed());
out_results->sync_entry = sync_entry;
}
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698