The Sparta Modeling Framework
|
Histogram base class for uint64_t values. More...
#include <Histogram.hpp>
Public Member Functions | |
void | addValue (uint64_t val) |
Add a value to histogram. | |
double | getStandardDeviation () const |
Calculate Standard Deviation of counts in bins. This API also takes into account the count in underflow and overflow bins. | |
double | getMeanBinCount () const |
Calculate the mean bin count of all the bins. This API also takes into account the count in underflow and overflow bins. | |
const sparta::Counter & | getAggValues () const |
Return aggregate of this histogram. | |
const std::vector< sparta::Counter > & | getRegularBin () const |
Return vector of regular bin counts. | |
const sparta::Counter & | getUnderflowBin () const |
Return count of underflow bin. | |
const sparta::Counter & | getOverflowBin () const |
Return count of overflow bin. | |
double | getUnderflowProbability () const |
Return underflow probability. | |
double | getOverflowProbability () const |
Return overflow probability. | |
const std::vector< double > & | recomputeRegularBinProbabilities () const |
Return vector of probabilities regular bins. | |
uint64_t | getHistogramUpperValue () const |
uint64_t | getHistogramLowerValue () const |
uint32_t | getNumBins () const |
uint32_t | getNumValuesPerBin () const |
Protected Member Functions | |
HistogramBase (uint64_t lower_val, uint64_t upper_val, uint32_t num_vals_per_bin) | |
HistogramBase constructor. | |
void | updateMaxValues_ (uint64_t val) |
std::string | getDisplayStringCumulative_ (const std::string &name) const |
Render the cumulative values of this histogram for use in standalone model. | |
void | initializeStats_ (StatisticSet *sset, const std::string &stat_prefix="", InstrumentationNode::Visibility bin_vis=InstrumentationNode::VIS_NORMAL, InstrumentationNode::Visibility prob_vis=InstrumentationNode::VIS_NORMAL, uint32_t num_max_values=0, InstrumentationNode::Visibility max_vis=InstrumentationNode::VIS_SUMMARY) |
Histogram base class for uint64_t values.
A histogram is usually thought of as having a lower limit, upper limit, and number of bins. This histogram class requires lower and upper limits, but instead of number of bins, it requires the user to specify number of values per bin. The number of bins is then calculated as below: number_of_bins = (upper_limit - lower_limit) / values_per_bin + 1
This is possible because this histogram only deals with positive integer values.
This class is the base class for two different Histograms: one which is a TreeNode, and one which is not.
Definition at line 41 of file Histogram.hpp.
|
inlineprotected |
HistogramBase constructor.
lower_val | the lower value of the histogram. Values lower than lower_val go into the underflow bin. |
upper_val | the upper value of the histogram. Values higher than upper_val go into the overflow bin. |
num_vals_per_bin | Number of values per bin. Must be power of two for fast devision. |
Definition at line 53 of file Histogram.hpp.
|
inline |
Add a value to histogram.
val | New value to add |
Definition at line 79 of file Histogram.hpp.
|
inline |
Return aggregate of this histogram.
Definition at line 151 of file Histogram.hpp.
|
inlineprotected |
Render the cumulative values of this histogram for use in standalone model.
Definition at line 236 of file Histogram.hpp.
|
inline |
Definition at line 202 of file Histogram.hpp.
|
inline |
Definition at line 201 of file Histogram.hpp.
|
inline |
Calculate the mean bin count of all the bins. This API also takes into account the count in underflow and overflow bins.
Definition at line 133 of file Histogram.hpp.
|
inline |
Definition at line 203 of file Histogram.hpp.
|
inline |
Definition at line 204 of file Histogram.hpp.
|
inline |
Return count of overflow bin.
Definition at line 172 of file Histogram.hpp.
|
inline |
Return overflow probability.
Definition at line 186 of file Histogram.hpp.
|
inline |
Return vector of regular bin counts.
Definition at line 158 of file Histogram.hpp.
|
inline |
Calculate Standard Deviation of counts in bins. This API also takes into account the count in underflow and overflow bins.
Definition at line 105 of file Histogram.hpp.
|
inline |
Return count of underflow bin.
Definition at line 165 of file Histogram.hpp.
|
inline |
Return underflow probability.
Definition at line 179 of file Histogram.hpp.
|
inlineprotected |
Initializes statistics within the histogram
sset | The statistic set to add all histogram stats into |
stat_prefix | String used as a prefix for all generated stat names |
bin_vis | Visibility of the bin / total / OF / UF stats |
prob_vis | Visibility of the probability stats |
num_max_values | Track the max 'num_max_values' seen as separate counters |
Definition at line 266 of file Histogram.hpp.
|
inline |
Return vector of probabilities regular bins.
Definition at line 193 of file Histogram.hpp.
|
inlineprotected |
Keep track of the maximum 'N' values seen
val | The value currently being added to the histogram |
Definition at line 212 of file Histogram.hpp.