diff options
-rw-r--r-- | net/disk_cache/entry_impl.cc | 16 | ||||
-rw-r--r-- | net/disk_cache/entry_impl.h | 4 |
2 files changed, 19 insertions, 1 deletions
diff --git a/net/disk_cache/entry_impl.cc b/net/disk_cache/entry_impl.cc index 920600d..976e16f 100644 --- a/net/disk_cache/entry_impl.cc +++ b/net/disk_cache/entry_impl.cc @@ -706,6 +706,12 @@ void EntryImpl::ReportIOTime(Operation op, const base::TimeTicks& start) { case kAsyncIO: CACHE_UMA(AGE_MS, "AsyncIOTime", group, start); break; + case kReadAsync1: + CACHE_UMA(AGE_MS, "AsyncReadDispatchTime", group, start); + break; + case kWriteAsync1: + CACHE_UMA(AGE_MS, "AsyncWriteDispatchTime", group, start); + break; default: NOTREACHED(); } @@ -991,6 +997,8 @@ int EntryImpl::InternalReadData(int index, int offset, net::IOBuffer* buf, net::NetLog::TYPE_ENTRY_READ_DATA); } + TimeTicks start_async = TimeTicks::Now(); + bool completed; if (!file->Read(buf->data(), buf_len, file_offset, io_callback, &completed)) { if (io_callback) @@ -1001,6 +1009,9 @@ int EntryImpl::InternalReadData(int index, int offset, net::IOBuffer* buf, if (io_callback && completed) io_callback->Discard(); + if (io_callback) + ReportIOTime(kReadAsync1, start_async); + ReportIOTime(kRead, start); return (completed || !callback) ? buf_len : net::ERR_IO_PENDING; } @@ -1085,6 +1096,8 @@ int EntryImpl::InternalWriteData(int index, int offset, net::IOBuffer* buf, net::NetLog::TYPE_ENTRY_WRITE_DATA); } + TimeTicks start_async = TimeTicks::Now(); + bool completed; if (!file->Write(buf->data(), buf_len, file_offset, io_callback, &completed)) { @@ -1096,6 +1109,9 @@ int EntryImpl::InternalWriteData(int index, int offset, net::IOBuffer* buf, if (io_callback && completed) io_callback->Discard(); + if (io_callback) + ReportIOTime(kWriteAsync1, start_async); + ReportIOTime(kWrite, start); return (completed || !callback) ? buf_len : net::ERR_IO_PENDING; } diff --git a/net/disk_cache/entry_impl.h b/net/disk_cache/entry_impl.h index 16657af..f76f703 100644 --- a/net/disk_cache/entry_impl.h +++ b/net/disk_cache/entry_impl.h @@ -30,7 +30,9 @@ class NET_EXPORT_PRIVATE EntryImpl kWrite, kSparseRead, kSparseWrite, - kAsyncIO + kAsyncIO, + kReadAsync1, + kWriteAsync1 }; EntryImpl(BackendImpl* backend, Addr address, bool read_only); |