19 #ifndef NDBT_STATS_HPP
20 #define NDBT_STATS_HPP
22 #include <ndb_global.h>
28 void reset() { sum = sum2 = 0.0; max = DBL_MIN; ; min = DBL_MAX; n = 0;}
30 void addObservation(
double t) {
38 void addObservation(Uint64 t) { addObservation(
double(t)); }
40 double getMean()
const {
return sum/n;}
41 double getStddev()
const {
return sqrt(getVariance()); }
42 double getVariance()
const {
return (n*sum2 - (sum*sum))/(n*n);}
43 double getMin()
const {
return min;}
44 double getMax()
const {
return max;}
45 int getCount()
const {
return n;}
51 if(min > c.min) min = c.min;
52 if(max < c.max) max = c.max;