summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrdsmith <rdsmith@chromium.org>2015-05-14 09:35:43 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-14 16:36:05 +0000
commit50fb5bbcda74bd2bb7428f82a97f2c43a9ef9690 (patch)
tree6986b60b33d00d96bd9e58a09338f9259fae3f7e
parentcf9be26f35fa706d770ae59dd6d185aed84edc17 (diff)
downloadchromium_src-50fb5bbcda74bd2bb7428f82a97f2c43a9ef9690.zip
chromium_src-50fb5bbcda74bd2bb7428f82a97f2c43a9ef9690.tar.gz
chromium_src-50fb5bbcda74bd2bb7428f82a97f2c43a9ef9690.tar.bz2
Add UMA for disk latency for cache accesses.
BUG=487749 Review URL: https://codereview.chromium.org/1134353003 Cr-Commit-Position: refs/heads/master@{#329857}
-rw-r--r--net/disk_cache/simple/simple_synchronous_entry.cc4
-rw-r--r--tools/metrics/histograms/histograms.xml8
2 files changed, 12 insertions, 0 deletions
diff --git a/net/disk_cache/simple/simple_synchronous_entry.cc b/net/disk_cache/simple/simple_synchronous_entry.cc
index f859105..542cede 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;
}
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index 7a26d3b..f5da3bf 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -37425,6 +37425,14 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary>
</histogram>
+<histogram name="SimpleCache.DiskOpenLatency" units="milliseconds">
+ <owner>rdsmith@chromium.org</owner>
+ <summary>
+ The time to access (open and read headers from all files) the cache entry on
+ disk.
+ </summary>
+</histogram>
+
<histogram name="SimpleCache.EntryCreationResult" enum="BooleanSuccess">
<obsolete>
Deprecated 2013-08 in favor of cache type specific version (App or Http).