diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-22 23:14:23 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-22 23:14:23 +0000 |
commit | b36a7bdca1c1ebc66e9b401296c90d1f69ae686c (patch) | |
tree | 8af2fd3186046226bf24c262a563f9605c3553f3 /net/disk_cache/block_files.cc | |
parent | 2c90e027622a681968bba29fba329c982333d791 (diff) | |
download | chromium_src-b36a7bdca1c1ebc66e9b401296c90d1f69ae686c.zip chromium_src-b36a7bdca1c1ebc66e9b401296c90d1f69ae686c.tar.gz chromium_src-b36a7bdca1c1ebc66e9b401296c90d1f69ae686c.tar.bz2 |
Disk cache: Use TimeTicks instead of Time for some of the
cache histograms.
BUG=14193
TEST=none
Review URL: http://codereview.chromium.org/650068
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39654 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/block_files.cc')
-rw-r--r-- | net/disk_cache/block_files.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/net/disk_cache/block_files.cc b/net/disk_cache/block_files.cc index fe02f67..3161317 100644 --- a/net/disk_cache/block_files.cc +++ b/net/disk_cache/block_files.cc @@ -12,6 +12,7 @@ #include "net/disk_cache/file_lock.h" using base::Time; +using base::TimeTicks; namespace { @@ -41,7 +42,7 @@ bool CreateMapBlock(int target, int size, disk_cache::BlockFileHeader* header, return false; } - Time start = Time::Now(); + TimeTicks start = TimeTicks::Now(); // We are going to process the map on 32-block chunks (32 bits), and on every // chunk, iterate through the 8 nibbles where the new block can be located. int current = header->hints[target - 1]; @@ -67,7 +68,7 @@ bool CreateMapBlock(int target, int size, disk_cache::BlockFileHeader* header, if (target != size) { header->empty[target - size - 1]++; } - HISTOGRAM_TIMES("DiskCache.CreateBlock", Time::Now() - start); + HISTOGRAM_TIMES("DiskCache.CreateBlock", TimeTicks::Now() - start); return true; } } @@ -86,7 +87,7 @@ void DeleteMapBlock(int index, int size, disk_cache::BlockFileHeader* header) { NOTREACHED(); return; } - Time start = Time::Now(); + TimeTicks start = TimeTicks::Now(); int byte_index = index / 8; uint8* byte_map = reinterpret_cast<uint8*>(header->allocation_map); uint8 map_block = byte_map[byte_index]; @@ -115,7 +116,7 @@ void DeleteMapBlock(int index, int size, disk_cache::BlockFileHeader* header) { } header->num_entries--; DCHECK(header->num_entries >= 0); - HISTOGRAM_TIMES("DiskCache.DeleteBlock", Time::Now() - start); + HISTOGRAM_TIMES("DiskCache.DeleteBlock", TimeTicks::Now() - start); } // Restores the "empty counters" and allocation hints. @@ -314,7 +315,7 @@ MappedFile* BlockFiles::FileForNewBlock(FileType block_type, int block_count) { MappedFile* file = block_files_[block_type - 1]; BlockFileHeader* header = reinterpret_cast<BlockFileHeader*>(file->buffer()); - Time start = Time::Now(); + TimeTicks start = TimeTicks::Now(); while (NeedToGrowBlockFile(header, block_count)) { if (kMaxBlocks == header->max_entries) { file = NextFile(file); @@ -328,7 +329,7 @@ MappedFile* BlockFiles::FileForNewBlock(FileType block_type, int block_count) { return NULL; break; } - HISTOGRAM_TIMES("DiskCache.GetFileForNewBlock", Time::Now() - start); + HISTOGRAM_TIMES("DiskCache.GetFileForNewBlock", TimeTicks::Now() - start); return file; } |