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

Unified Diff: net/disk_cache/entry_impl.cc

Issue 178023: Disk cache: Add a histogram to measure the latency of... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 4 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
« net/disk_cache/entry_impl.h ('K') | « net/disk_cache/entry_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/entry_impl.cc
===================================================================
--- net/disk_cache/entry_impl.cc (revision 24800)
+++ net/disk_cache/entry_impl.cc (working copy)
@@ -29,7 +29,7 @@
public:
SyncCallback(disk_cache::EntryImpl* entry, net::IOBuffer* buffer,
net::CompletionCallback* callback )
- : entry_(entry), callback_(callback), buf_(buffer) {
+ : entry_(entry), callback_(callback), buf_(buffer), start_(Time::Now()) {
entry->AddRef();
entry->IncrementIoCount();
}
@@ -41,15 +41,18 @@
disk_cache::EntryImpl* entry_;
net::CompletionCallback* callback_;
scoped_refptr<net::IOBuffer> buf_;
+ Time start_;
DISALLOW_EVIL_CONSTRUCTORS(SyncCallback);
};
void SyncCallback::OnFileIOComplete(int bytes_copied) {
entry_->DecrementIoCount();
+ if (callback_) {
+ entry_->ReportIOTime(disk_cache::EntryImpl::kAsyncIO, start_);
+ callback_->Run(bytes_copied);
+ }
entry_->Release();
- if (callback_)
- callback_->Run(bytes_copied);
delete this;
}
@@ -880,6 +883,9 @@
case kSparseWrite:
CACHE_UMA(AGE_MS, "SparseWriteTime", 0, start);
break;
+ case kAsyncIO:
+ CACHE_UMA(AGE_MS, "AsyncIOTime", group, start);
+ break;
default:
NOTREACHED();
}
« net/disk_cache/entry_impl.h ('K') | « net/disk_cache/entry_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698