Commit 50fb5bbc authored by rdsmith's avatar rdsmith Committed by Commit bot

Add UMA for disk latency for cache accesses.

BUG=487749

Review URL: https://codereview.chromium.org/1134353003

Cr-Commit-Position: refs/heads/master@{#329857}
parent cf9be26f
...@@ -14,9 +14,11 @@ ...@@ -14,9 +14,11 @@
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/hash.h" #include "base/hash.h"
#include "base/location.h" #include "base/location.h"
#include "base/metrics/histogram.h"
#include "base/numerics/safe_conversions.h" #include "base/numerics/safe_conversions.h"
#include "base/sha1.h" #include "base/sha1.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/timer/elapsed_timer.h"
#include "net/base/io_buffer.h" #include "net/base/io_buffer.h"
#include "net/base/net_errors.h" #include "net/base/net_errors.h"
#include "net/disk_cache/simple/simple_backend_version.h" #include "net/disk_cache/simple/simple_backend_version.h"
...@@ -216,6 +218,7 @@ void SimpleSynchronousEntry::OpenEntry( ...@@ -216,6 +218,7 @@ void SimpleSynchronousEntry::OpenEntry(
const uint64 entry_hash, const uint64 entry_hash,
bool had_index, bool had_index,
SimpleEntryCreationResults *out_results) { SimpleEntryCreationResults *out_results) {
base::ElapsedTimer open_time;
SimpleSynchronousEntry* sync_entry = SimpleSynchronousEntry* sync_entry =
new SimpleSynchronousEntry(cache_type, path, "", entry_hash); new SimpleSynchronousEntry(cache_type, path, "", entry_hash);
out_results->result = out_results->result =
...@@ -230,6 +233,7 @@ void SimpleSynchronousEntry::OpenEntry( ...@@ -230,6 +233,7 @@ void SimpleSynchronousEntry::OpenEntry(
out_results->stream_0_data = NULL; out_results->stream_0_data = NULL;
return; return;
} }
UMA_HISTOGRAM_TIMES("SimpleCache.DiskOpenLatency", open_time.Elapsed());
out_results->sync_entry = sync_entry; out_results->sync_entry = sync_entry;
} }
......
...@@ -37425,6 +37425,14 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -37425,6 +37425,14 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary> </summary>
</histogram> </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"> <histogram name="SimpleCache.EntryCreationResult" enum="BooleanSuccess">
<obsolete> <obsolete>
Deprecated 2013-08 in favor of cache type specific version (App or Http). Deprecated 2013-08 in favor of cache type specific version (App or Http).
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