summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-12 20:51:12 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-12 20:51:12 +0000
commitb810aa3cd171acccac12ee440bd0ca44784c9e53 (patch)
tree75ad9c11f38738dc946e1bbfb7218d4af75fdad3
parenta3936602d482942c4fd64245f809320a8d251995 (diff)
downloadchromium_src-b810aa3cd171acccac12ee440bd0ca44784c9e53.zip
chromium_src-b810aa3cd171acccac12ee440bd0ca44784c9e53.tar.gz
chromium_src-b810aa3cd171acccac12ee440bd0ca44784c9e53.tar.bz2
Back off the histograms change.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@741 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--net/disk_cache/backend_impl.cc10
-rw-r--r--net/disk_cache/block_files.cc8
-rw-r--r--net/disk_cache/entry_impl.cc17
-rw-r--r--net/disk_cache/rankings.cc5
4 files changed, 0 insertions, 40 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc
index 9ffb97e..0a09148 100644
--- a/net/disk_cache/backend_impl.cc
+++ b/net/disk_cache/backend_impl.cc
@@ -30,7 +30,6 @@
#include "net/disk_cache/backend_impl.h"
#include "base/file_util.h"
-#include "base/histogram.h"
#include "base/message_loop.h"
#include "base/scoped_handle.h"
#include "base/string_util.h"
@@ -326,7 +325,6 @@ bool BackendImpl::OpenEntry(const std::string& key, Entry** entry) {
if (disabled_)
return false;
- Time start = Time::Now();
uint32 hash = Hash(key);
EntryImpl* cache_entry = MatchEntry(key, hash, false);
@@ -338,7 +336,6 @@ bool BackendImpl::OpenEntry(const std::string& key, Entry** entry) {
DCHECK(entry);
*entry = cache_entry;
- UMA_HISTOGRAM_TIMES(L"DiskCache.OpenTime", Time::Now() - start);
stats_.OnEvent(Stats::OPEN_HIT);
return true;
}
@@ -347,7 +344,6 @@ bool BackendImpl::CreateEntry(const std::string& key, Entry** entry) {
if (disabled_ || key.empty())
return false;
- Time start = Time::Now();
uint32 hash = Hash(key);
scoped_refptr<EntryImpl> parent;
@@ -410,7 +406,6 @@ bool BackendImpl::CreateEntry(const std::string& key, Entry** entry) {
*entry = NULL;
cache_entry.swap(reinterpret_cast<EntryImpl**>(entry));
- UMA_HISTOGRAM_TIMES(L"DiskCache.CreateTime", Time::Now() - start);
stats_.OnEvent(Stats::CREATE_HIT);
Trace("create entry hit ");
return true;
@@ -1039,7 +1034,6 @@ void BackendImpl::TrimCache(bool empty) {
if (disabled_)
return;
- Time start = Time::Now();
Rankings::ScopedRankingsBlock node(&rankings_);
Rankings::ScopedRankingsBlock next(&rankings_, rankings_.GetPrev(node.get()));
DCHECK(next.get());
@@ -1059,9 +1053,6 @@ void BackendImpl::TrimCache(bool empty) {
if (node->Data()->pointer) {
entry = EntryImpl::Update(entry);
}
- static Histogram counter(L"DiskCache.TrimAge", 1, 10000, 50);
- counter.SetFlags(kUmaTargetedHistogramFlag);
- counter.Add((Time::Now() - entry->GetLastUsed()).InHours());
entry->Doom();
entry->Release();
if (!empty)
@@ -1069,7 +1060,6 @@ void BackendImpl::TrimCache(bool empty) {
}
}
- UMA_HISTOGRAM_TIMES(L"DiskCache.TotalTrimTime", Time::Now() - start);
Trace("*** Trim Cache end ***");
return;
}
diff --git a/net/disk_cache/block_files.cc b/net/disk_cache/block_files.cc
index 93578cf..e985765 100644
--- a/net/disk_cache/block_files.cc
+++ b/net/disk_cache/block_files.cc
@@ -29,10 +29,8 @@
#include "net/disk_cache/block_files.h"
-#include "base/histogram.h"
#include "base/scoped_handle.h"
#include "base/string_util.h"
-#include "base/time.h"
#include "net/disk_cache/file_lock.h"
namespace {
@@ -63,7 +61,6 @@ bool CreateMapBlock(int target, int size, disk_cache::BlockFileHeader* header,
return false;
}
- Time start = Time::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];
@@ -89,7 +86,6 @@ bool CreateMapBlock(int target, int size, disk_cache::BlockFileHeader* header,
if (target != size) {
header->empty[target - size - 1]++;
}
- HISTOGRAM_TIMES(L"DiskCache.CreateBlock", Time::Now() - start);
return true;
}
}
@@ -108,7 +104,6 @@ void DeleteMapBlock(int index, int size, disk_cache::BlockFileHeader* header) {
NOTREACHED();
return;
}
- Time start = Time::Now();
int byte_index = index / 8;
uint8* byte_map = reinterpret_cast<uint8*>(header->allocation_map);
uint8 map_block = byte_map[byte_index];
@@ -137,7 +132,6 @@ void DeleteMapBlock(int index, int size, disk_cache::BlockFileHeader* header) {
}
header->num_entries--;
DCHECK(header->num_entries >= 0);
- HISTOGRAM_TIMES(L"DiskCache.DeleteBlock", Time::Now() - start);
}
// Restores the "empty counters" and allocation hints.
@@ -319,7 +313,6 @@ 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();
while (NeedToGrowBlockFile(header, block_count)) {
if (kMaxBlocks == header->max_entries) {
file = NextFile(file);
@@ -333,7 +326,6 @@ MappedFile* BlockFiles::FileForNewBlock(FileType block_type, int block_count) {
return NULL;
break;
}
- HISTOGRAM_TIMES(L"DiskCache.GetFileForNewBlock", Time::Now() - start);
return file;
}
diff --git a/net/disk_cache/entry_impl.cc b/net/disk_cache/entry_impl.cc
index 3d3ada2..58509c1 100644
--- a/net/disk_cache/entry_impl.cc
+++ b/net/disk_cache/entry_impl.cc
@@ -29,7 +29,6 @@
#include "net/disk_cache/entry_impl.h"
-#include "base/histogram.h"
#include "base/message_loop.h"
#include "base/string_util.h"
#include "net/base/net_errors.h"
@@ -123,8 +122,6 @@ EntryImpl::EntryImpl(BackendImpl* backend, Addr address)
// written before).
EntryImpl::~EntryImpl() {
if (doomed_) {
- UMA_HISTOGRAM_COUNTS(L"DiskCache.DeleteHeader", GetDataSize(0));
- UMA_HISTOGRAM_COUNTS(L"DiskCache.DeleteData", GetDataSize(1));
for (int index = 0; index < kKeyFileIndex; index++) {
Addr address(entry_.Data()->data_addr[index]);
if (address.is_initialized()) {
@@ -242,11 +239,6 @@ int EntryImpl::ReadData(int index, int offset, char* buf, int buf_len,
if (buf_len < 0)
return net::ERR_INVALID_ARGUMENT;
- Time start = Time::Now();
- static Histogram stats(L"DiskCache.ReadTime", TimeDelta::FromMilliseconds(1),
- TimeDelta::FromSeconds(10), 50);
- stats.SetFlags(kUmaTargetedHistogramFlag);
-
if (offset + buf_len > entry_size)
buf_len = entry_size - offset;
@@ -258,7 +250,6 @@ int EntryImpl::ReadData(int index, int offset, char* buf, int buf_len,
// Complete the operation locally.
DCHECK(kMaxBlockSize >= offset + buf_len);
memcpy(buf , user_buffers_[index].get() + offset, buf_len);
- stats.AddTime(Time::Now() - start);
return buf_len;
}
@@ -290,7 +281,6 @@ int EntryImpl::ReadData(int index, int offset, char* buf, int buf_len,
if (io_callback && completed)
io_callback->Discard();
- stats.AddTime(Time::Now() - start);
return (completed || !completion_callback) ? buf_len : net::ERR_IO_PENDING;
}
@@ -316,11 +306,6 @@ int EntryImpl::WriteData(int index, int offset, const char* buf, int buf_len,
return net::ERR_FAILED;
}
- Time start = Time::Now();
- static Histogram stats(L"DiskCache.WriteTime", TimeDelta::FromMilliseconds(1),
- TimeDelta::FromSeconds(10), 50);
- stats.SetFlags(kUmaTargetedHistogramFlag);
-
// Read the size at this point (it may change inside prepare).
int entry_size = entry_.Data()->data_size[index];
if (!PrepareTarget(index, offset, buf_len, truncate))
@@ -352,7 +337,6 @@ int EntryImpl::WriteData(int index, int offset, const char* buf, int buf_len,
// Complete the operation locally.
DCHECK(kMaxBlockSize >= offset + buf_len);
memcpy(user_buffers_[index].get() + offset, buf, buf_len);
- stats.AddTime(Time::Now() - start);
return buf_len;
}
@@ -387,7 +371,6 @@ int EntryImpl::WriteData(int index, int offset, const char* buf, int buf_len,
if (io_callback && completed)
io_callback->Discard();
- stats.AddTime(Time::Now() - start);
return (completed || !completion_callback) ? buf_len : net::ERR_IO_PENDING;
}
diff --git a/net/disk_cache/rankings.cc b/net/disk_cache/rankings.cc
index 42667cc..81b5767 100644
--- a/net/disk_cache/rankings.cc
+++ b/net/disk_cache/rankings.cc
@@ -29,7 +29,6 @@
#include "net/disk_cache/rankings.h"
-#include "base/histogram.h"
#include "net/disk_cache/backend_impl.h"
#include "net/disk_cache/entry_impl.h"
#include "net/disk_cache/errors.h"
@@ -204,7 +203,6 @@ void Rankings::Reset() {
}
bool Rankings::GetRanking(CacheRankingsBlock* rankings) {
- Time start = Time::Now();
if (!rankings->address().is_initialized())
return false;
@@ -235,7 +233,6 @@ bool Rankings::GetRanking(CacheRankingsBlock* rankings) {
EntryImpl* cache_entry =
reinterpret_cast<EntryImpl*>(rankings->Data()->pointer);
rankings->SetData(cache_entry->rankings()->Data());
- UMA_HISTOGRAM_TIMES(L"DiskCache.GetRankings", Time::Now() - start);
return true;
}
@@ -383,10 +380,8 @@ void Rankings::Remove(CacheRankingsBlock* node) {
// but the net effect is just an assert on debug when attempting to remove the
// entry. Otherwise we'll need reentrant transactions, which is an overkill.
void Rankings::UpdateRank(CacheRankingsBlock* node, bool modified) {
- Time start = Time::Now();
Remove(node);
Insert(node, modified);
- UMA_HISTOGRAM_TIMES(L"DiskCache.UpdateRank", Time::Now() - start);
}
void Rankings::CompleteTransaction() {