Classes | |
struct | HistogramBody |
Public Member Functions | |
virtual void | Add (double value) |
Record a value in its bucket. | |
virtual void | Clear () |
Throw away all data. | |
virtual int | MaxBuckets () |
virtual void | EnableNegativeBuckets () |
virtual void | SetMinValue (double value) |
Set the minimum value allowed in histogram. | |
virtual void | SetMaxValue (double value) |
virtual void | SetMaxBuckets (int i) |
size_t | AllocationSize () |
Protected Member Functions | |
virtual AbstractMutex * | lock () |
virtual double | AverageInternal () |
virtual double | PercentileInternal (const double perc) |
virtual double | StandardDeviationInternal () |
virtual double | CountInternal () |
virtual double | MaximumInternal () |
virtual double | MinimumInternal () |
virtual double | BucketStart (int index) |
virtual double | BucketCount (int index) |
Value of a bucket. | |
Friends | |
class | SharedMemStatistics |
size_t net_instaweb::SharedMemHistogram::AllocationSize | ( | ) | [inline] |
Return the allocation size for this Histogram object except Mutex size. Shared memory space should include a mutex, HistogramBody and sizeof(double) * MaxBuckets(). Here we do not know mutex size.
virtual double net_instaweb::SharedMemHistogram::BucketStart | ( | int | index | ) | [protected, virtual] |
Lower bound of a bucket. If index == MaxBuckets() + 1, returns the upper bound of the histogram. DCHECK if index is in the range of [0, MaxBuckets()+1].
Implements net_instaweb::Histogram.
virtual void net_instaweb::SharedMemHistogram::EnableNegativeBuckets | ( | ) | [virtual] |
Call the following functions after statistics->Init and before add values. EnableNegativeBuckets, SetMinValue and SetMaxValue will cause resetting Histogram.
Implements net_instaweb::Histogram.
virtual int net_instaweb::SharedMemHistogram::MaxBuckets | ( | ) | [virtual] |
Maxmum number of buckets. This number can be used to allocate a buffer for Histogram.
Implements net_instaweb::Histogram.
virtual void net_instaweb::SharedMemHistogram::SetMaxBuckets | ( | int | i | ) | [virtual] |
We rely on MaxBuckets to allocate memory segment for histogram. If we want to call SetMaxBuckets(), we should call it right after AddHistogram().
Implements net_instaweb::Histogram.
virtual void net_instaweb::SharedMemHistogram::SetMaxValue | ( | double | value | ) | [virtual] |
Set the upper-bound of value in histogram, The value range in histogram is [MinValue, MaxValue) or (-MaxValue, MaxValue) if negative buckets are enabled.
Implements net_instaweb::Histogram.