6 #ifndef RUNTIMESTATS_HPP_INCLUDE
7 #define RUNTIMESTATS_HPP_INCLUDE
21 RuntimeStats(
const std::vector<std::string> &metric_names);
41 uint64_t
count(
int metric_idx)
const;
48 double first(
int metric_idx)
const;
55 double last(
int metric_idx)
const;
62 double min(
int metric_idx)
const;
69 double max(
int metric_idx)
const;
76 double mean(
int metric_idx)
const;
83 double std(
int metric_idx)
const;
92 void update(
const std::vector<double> &sample);
94 void check_index(
int metric_idx,
const std::string &func,
int line)
const;
96 stats_s &operator=(
const stats_s &other);
105 const std::vector<std::string> m_metric_names;
106 std::vector<stats_s> m_metric_stats;
Class that aggregates statistics without buffered data.
Definition: RuntimeStats.hpp:17
double last(int metric_idx) const
Last non-null value sampled.
Definition: RuntimeStats.cpp:57
void update(const std::vector< double > &sample)
Update statistics with new sample.
Definition: RuntimeStats.cpp:126
double max(int metric_idx) const
Maximum value sampled.
Definition: RuntimeStats.cpp:77
virtual ~RuntimeStats()=default
Default virtual destructor.
double std(int metric_idx) const
Estimate of standard deviation.
Definition: RuntimeStats.cpp:98
void reset(void)
Reset all aggregated statistics.
Definition: RuntimeStats.cpp:117
double mean(int metric_idx) const
Mean value sampled.
Definition: RuntimeStats.cpp:87
uint64_t count(int metric_idx) const
Number of non-null values sampled.
Definition: RuntimeStats.cpp:41
std::string metric_name(int metric_idx) const
Name of one metrics.
Definition: RuntimeStats.cpp:35
double first(int metric_idx) const
First non-null value sampled.
Definition: RuntimeStats.cpp:47
int num_metric(void) const
Number of metrics aggregated.
Definition: RuntimeStats.cpp:22
double min(int metric_idx) const
Minimum value sampled.
Definition: RuntimeStats.cpp:67