diff options
author | Alberto Lerner <alerner@10gen.com> | 2010-06-11 12:52:20 -0400 |
---|---|---|
committer | Alberto Lerner <alerner@10gen.com> | 2010-06-11 12:52:20 -0400 |
commit | 73d7c86b4aef71d7fcebe711032be834d5b5a7a3 (patch) | |
tree | dc1e44e59e964214fb4aeb2df3727dde7f3a78b3 /db/stats | |
parent | 4bbfd226944dd8b0ab902ad9457d4be58175a13f (diff) | |
download | mongo-73d7c86b4aef71d7fcebe711032be834d5b5a7a3.tar.gz |
Use exponential histograms for cumulative stats
Diffstat (limited to 'db/stats')
-rw-r--r-- | db/stats/service_stats.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/db/stats/service_stats.cpp b/db/stats/service_stats.cpp index 0d66abb74ac..5574ecb108a 100644 --- a/db/stats/service_stats.cpp +++ b/db/stats/service_stats.cpp @@ -26,21 +26,20 @@ namespace mongo { using std::ostringstream; ServiceStats::ServiceStats(){ - // TODO exponentially increasing buckets perhaps would be - // better for the following histograms - - // Time histogram covers up to 2.5msec in 250usec intervals - // (and lumps anything higher in last bucket) + // Time histogram covers up to 128msec in exponential intervals + // starting at 125usec. Histogram::Options timeOpts; - timeOpts.numBuckets = 10; - timeOpts.bucketSize = 250; + timeOpts.numBuckets = 12; + timeOpts.bucketSize = 125; + timeOpts.exponential = true; _timeHistogram = new Histogram( timeOpts ); - // Space histogram covers up to 4MB in 256k intervals (and - // lumps anything higher in last bucket) + // Space histogram covers up to 1MB in exponentialintervals starting + // at 1K. Histogram::Options spaceOpts; - spaceOpts.numBuckets = 16; - spaceOpts.bucketSize = 2 << 18; + spaceOpts.numBuckets = 12; + spaceOpts.bucketSize = 1024; + spaceOpts.exponential = true; _spaceHistogram = new Histogram( spaceOpts ); } |