From: g0dil Date: Tue, 29 Sep 2009 15:25:25 +0000 (+0000) Subject: Utils: Fix Statistics fix X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=aeb0c2aa1abbae3d48b927b45a457bb9e0530858;p=senf.git Utils: Fix Statistics fix git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1460 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Utils/Statistics.cc b/senf/Utils/Statistics.cc index 0d5e947..a2363ca 100644 --- a/senf/Utils/Statistics.cc +++ b/senf/Utils/Statistics.cc @@ -287,17 +287,10 @@ prefix_ std::string senf::Statistics::v_path() prefix_ void senf::Collector::enter(float min, float avg, float max) { accAvg_ += avg; - if (avg < accMin_) accMin_ = avg; - if (avg > accMax_) accMax_ = avg; + if (min < accMin_) accMin_ = min; + if (max > accMax_) accMax_ = max; if (++i_ >= rank_) { - 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_); - } + StatisticsBase::enter(accMin_, accAvg_ / i_, accMax_); i_ = 0; accMin_ = FLT_MAX; accAvg_ = 0.0f; diff --git a/site_scons/site_init.py b/site_scons/site_init.py index dac80c8..088c479 100644 --- a/site_scons/site_init.py +++ b/site_scons/site_init.py @@ -43,7 +43,7 @@ if os.path.dirname(os.path.dirname(os.path.abspath(SCons.__file__))) != sconseng cdir = os.path.normpath(cdir) if cdir.startswith('../'): SCons.Util.display("scons: WARNING: failed to undo -C option") - elif cdir != '.': + elif cdir != '.' and not cdir.startswith('/'): os.chdir('/'.join(('..' for _ in cdir.split('/')))) os.environ['SCONS_LIB_DIR'] = sconsengine os.execv(sconsscript, sys.argv)