diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-24 23:51:25 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-24 23:51:25 +0000 |
commit | e2951cf3bd7e591a64ad5199a61531dac0ec58d2 (patch) | |
tree | 3039f816f6fa46008865c1ce4b1dd15de7b48d5a /net/disk_cache/stats.h | |
parent | 0e8db94aef1b57355c3d154cb4682ce2f94c51eb (diff) | |
download | chromium_src-e2951cf3bd7e591a64ad5199a61531dac0ec58d2.zip chromium_src-e2951cf3bd7e591a64ad5199a61531dac0ec58d2.tar.gz chromium_src-e2951cf3bd7e591a64ad5199a61531dac0ec58d2.tar.bz2 |
Use histograms to send interesting parts of the disk cache statistics.
Most of this CL deals with a derived implementation of histograms that just
queries the size stats already generated by the disk cache. The exact number
of buckets, and their distribution, is controlled directly by the new class and
the disk cache stats code.
Review URL: http://codereview.chromium.org/3069
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2580 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/stats.h')
-rw-r--r-- | net/disk_cache/stats.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/net/disk_cache/stats.h b/net/disk_cache/stats.h index 24f99bc..a811e3f 100644 --- a/net/disk_cache/stats.h +++ b/net/disk_cache/stats.h @@ -2,13 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef NET_DISK_CACHE_STATS_H__ -#define NET_DISK_CACHE_STATS_H__ +#ifndef NET_DISK_CACHE_STATS_H_ +#define NET_DISK_CACHE_STATS_H_ #include <string> #include <vector> #include "base/basictypes.h" +#include "base/scoped_ptr.h" +#include "net/disk_cache/stats_histogram.h" namespace disk_cache { @@ -57,6 +59,11 @@ class Stats { void GetItems(StatsItems* items); + // Support for StatsHistograms. Together, these methods allow StatsHistograms + // to take a snapshot of the data_sizes_ as the histogram data. + int GetBucketRange(size_t i) const; + void Snapshot(StatsHistogram::StatsSamples* samples) const; + private: int GetStatsBucket(int32 size); @@ -64,11 +71,12 @@ class Stats { uint32 storage_addr_; int data_sizes_[kDataSizesLength]; int64 counters_[MAX_COUNTER]; + scoped_ptr<StatsHistogram> size_histogram_; - DISALLOW_EVIL_CONSTRUCTORS(Stats); + DISALLOW_COPY_AND_ASSIGN(Stats); }; } // namespace disk_cache -#endif // NET_DISK_CACHE_STATS_H__ +#endif // NET_DISK_CACHE_STATS_H_ |