A basic histogram class.

Synopsis

Declared in <folly/stats/Histogram.h>

template<typename T>
class Histogram;

Description

Groups data points into equally‐sized buckets, and stores the overall sum of the data points in each bucket, as well as the number of data points in the bucket.

The caller must specify the minimum and maximum data points to expect ahead of time, as well as the bucket width.

Types

Name

Description

AvgFromBucket

Function object returning the average of the values in a bucket.

CountFromBucket

Function object returning the value count stored in a bucket.

Type Aliases

Name

Description

Bucket

The bucket type used to accumulate values.

ValueType

The type of value stored in the histogram.

Member Functions

Name

Description

Histogram [constructor]

Constructs a histogram over the given range with the given bucket size.

addRepeatedValue

Add multiple same data points to the histogram

addValue

Add a data point to the histogram

clear

Remove all data points from the histogram

computeTotalCount

Computes the total number of values stored across all buckets.

copy

Copy bucket values from another histogram

debugString

Get a human‐readable string describing the histogram contents

getBucketByIndex

Returns the specified bucket (for reading only!)

getBucketMax

Returns the maximum threshold for the bucket at the given index.

getBucketMin

Returns the minimum threshold for the bucket at the given index.

getBucketSize

Returns the bucket size of each bucket in the histogram.

getMax

Returns the max value at which bucketing ends.

getMin

Returns the min value at which bucketing begins.

getNumBuckets

Returns the number of buckets

getPercentileBucketIdx

Get the bucket that the specified percentile falls into

getPercentileEstimate

Estimate the value at the specified percentile.

merge

Merge two histogram data together

removeRepeatedValue

Remove multiple same data points from the histogram

removeValue

Remove a data point to the histogram

subtract

Subtract another histogram data from the histogram

toTSV

Write the histogram contents in tab‐separated values (TSV) format. Format is "min max count sum".

Created with MrDocs