19 MinMaxSum() : _minValue(0), _maxValue(0), _cumulatedValue(0) {}
21 : _minValue(minValue), _maxValue(maxValue), _cumulatedValue(cumulatedValue)
24 const float&
minValue()
const {
return _minValue;}
25 const float&
maxValue()
const {
return _maxValue;}
30 _minValue = _maxValue = _cumulatedValue = val;
33 _cumulatedValue += val;
34 _minValue = (std::min)(_minValue, val);
35 _maxValue = (std::max)(_maxValue, val);
40 _minValue = _maxValue = _cumulatedValue = 0;
45 s << (_cumulatedValue / (float)count) <<
' ' << _minValue <<
' ' << _maxValue;
51 float _cumulatedValue;
61 : _count(count), _wall(wall), _user(user), _system(system)
65 _wall.
push(wall, _count==0);
66 _user.
push(user, _count==0);
67 _system.
push(system, _count==0);
73 const unsigned int&
count()
const {
return _count;}
Store statistics about method calls.
std::string asString(unsigned int count) const
const float & maxValue() const
Stores min, max and sum of values fed to it.
MethodStatistics(unsigned count, MinMaxSum wall, MinMaxSum user, MinMaxSum system)
MinMaxSum(float minValue, float maxValue, float cumulatedValue)
void push(float val, bool init=false)
const MinMaxSum & wall() const
const unsigned int & count() const
void push(float wall, float user, float system)
const MinMaxSum & system() const
const MinMaxSum & user() const
const float & cumulatedValue() const
const float & minValue() const
QI_API_DEPRECATED void init(int &argc, char **&argv)