From: mtk Date: Mon, 28 Sep 2009 21:18:28 +0000 (+0000) Subject: calc min/max of the individual avgs for rank > 1 X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=5a0a897af1c843762f90f316fc7608e9578901ea;p=senf.git calc min/max of the individual avgs for rank > 1 git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1457 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Utils/Statistics.cc b/senf/Utils/Statistics.cc index a9cb325..0d5e947 100644 --- a/senf/Utils/Statistics.cc +++ b/senf/Utils/Statistics.cc @@ -81,7 +81,7 @@ senf::StatisticsBase::output(unsigned n) } // -// generate an engineering style notation i +// generate an engineering style notation // char *format_eng( float f) { @@ -287,10 +287,17 @@ prefix_ std::string senf::Statistics::v_path() prefix_ void senf::Collector::enter(float min, float avg, float max) { accAvg_ += avg; - if (min < accMin_) accMin_ = min; - if (max > accMax_) accMax_ = max; + if (avg < accMin_) accMin_ = avg; + if (avg > accMax_) accMax_ = avg; if (++i_ >= rank_) { - StatisticsBase::enter(accMin_, accAvg_ / rank_, accMax_); + if( i_ == 1){ + // no averaging, report min & max for this period + StatisticsBase::enter(min, avg, max); + } + else{ + // averaging, report min(avgs) and max(avgs) + StatisticsBase::enter(accMin_, accAvg_ / rank_, accMax_); + } i_ = 0; accMin_ = FLT_MAX; accAvg_ = 0.0f;