X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FUtils%2FStatistics.cci;h=27c953dcdbc7c94f358dfcf950008a993975f707;hb=21be434729b552e31b856b2f42fc978062d0dd55;hp=1f109dbe22c402152f6a217445d41d5147772ed5;hpb=601d1f509f5bb24df167a4dd5a20da67a0af9af8;p=senf.git diff --git a/senf/Utils/Statistics.cci b/senf/Utils/Statistics.cci index 1f109db..27c953d 100644 --- a/senf/Utils/Statistics.cci +++ b/senf/Utils/Statistics.cci @@ -46,27 +46,29 @@ senf::StatisticsBase::Transform::operator()(first_argument_type i) // senf::StatisticsBase::OutputEntry prefix_ senf::StatisticsBase::OutputEntry::OutputEntry() - : n(), min(), avg(), max() + : n(), min(), avg(), max(), dev() { initDir(); } prefix_ senf::StatisticsBase::OutputEntry::OutputEntry(unsigned n_) - : n(n_), min(), avg(), max() + : n(n_), min(), avg(), max(), dev() { initDir(); } prefix_ senf::StatisticsBase::OutputEntry::OutputEntry(const OutputEntry& other) - : n(other.n), min(other.min), avg(other.avg), max(other.max) + : n(other.n), min(other.min), avg(other.avg), max(other.max), dev(other.dev) { initDir(); } prefix_ void senf::StatisticsBase::OutputEntry::initDir() { - dir.add("list", senf::membind(&OutputEntry::consoleList, this)) - .doc("List all known connected targets. This list might not be complete."); + namespace fty = senf::console::factory; + + dir.add("list", fty::Command(this,&OutputEntry::consoleList) + .doc("List all known connected targets. This list might not be complete.") ); } prefix_ senf::StatisticsBase::OutputEntry & @@ -76,6 +78,7 @@ senf::StatisticsBase::OutputEntry::operator=(const OutputEntry& other) min = other.min; avg = other.avg; max = other.max; + dev = other.dev; return *this; } @@ -91,7 +94,7 @@ prefix_ void senf::StatisticsBase::OutputEntry::consoleList(std::ostream & os) // senf::StatisticsBase prefix_ senf::StatisticsBase::StatisticsBase() - : min_ (0.0f), avg_ (0.0f), max_ (0.0f), maxQueueLen_ (0u) + : min_ (0.0f), avg_ (0.0f), max_ (0.0f), dev_ (0.0f), maxQueueLen_ (0u) {} prefix_ senf::StatisticsBase::~StatisticsBase() @@ -120,6 +123,12 @@ prefix_ float senf::StatisticsBase::max() return max_; } +prefix_ float senf::StatisticsBase::dev() + const +{ + return dev_; +} + prefix_ unsigned senf::StatisticsBase::rank() const { @@ -141,7 +150,7 @@ prefix_ std::string senf::StatisticsBase::path() // senf::Collector prefix_ senf::Collector::Collector(StatisticsBase * owner, unsigned rank) - : rank_ (rank), i_ (0u), accMin_ (FLT_MAX), accAvg_ (0.0f), accMax_ (-FLT_MAX), + : rank_ (rank), i_ (0u), accMin_ (FLT_MAX), accSum_ (0.0f), accSumSq_ (0.0f), accMax_ (-FLT_MAX), owner_ (owner) {} @@ -161,14 +170,14 @@ senf::Collector::output(unsigned n) /////////////////////////////////////////////////////////////////////////// // senf::Statistics -prefix_ void senf::Statistics::operator()(float min, float avg, float max) +prefix_ void senf::Statistics::operator()(float min, float avg, float max, float dev) { - enter(min, avg, max); + enter(min, avg, max, dev); } -prefix_ void senf::Statistics::operator()(float value) +prefix_ void senf::Statistics::operator()(float value, float dev) { - enter(value, value, value); + enter(value, value, value, dev); } prefix_ senf::StatisticsBase::OutputProxy