X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FUtils%2FStatistics.cci;h=762aa0d5cdca000980f1ce06745df8a2f023b361;hb=92d091c2e5b387ca0c9930c7bc88d9b45630a845;hp=27c953dcdbc7c94f358dfcf950008a993975f707;hpb=21be434729b552e31b856b2f42fc978062d0dd55;p=senf.git diff --git a/senf/Utils/Statistics.cci b/senf/Utils/Statistics.cci index 27c953d..762aa0d 100644 --- a/senf/Utils/Statistics.cci +++ b/senf/Utils/Statistics.cci @@ -1,6 +1,6 @@ // $Id$ // -// Copyright (C) 2008 +// Copyright (C) 2008 // Fraunhofer Institute for Open Communication Systems (FOKUS) // Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund @@ -30,9 +30,9 @@ #include "Range.hh" #define prefix_ inline -///////////////////////////////cci.p/////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// // senf::StatisticsBase::Transform prefix_ senf::StatisticsBase::Transform::result_type @@ -42,7 +42,7 @@ senf::StatisticsBase::Transform::operator()(first_argument_type i) return i.second; } -/////////////////////////////////////////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// // senf::StatisticsBase::OutputEntry prefix_ senf::StatisticsBase::OutputEntry::OutputEntry() @@ -67,7 +67,7 @@ prefix_ void senf::StatisticsBase::OutputEntry::initDir() { namespace fty = senf::console::factory; - dir.add("list", fty::Command(this,&OutputEntry::consoleList) + dir.add("list", fty::Command(&OutputEntry::consoleList, this) .doc("List all known connected targets. This list might not be complete.") ); } @@ -82,15 +82,7 @@ senf::StatisticsBase::OutputEntry::operator=(const OutputEntry& other) return *this; } -prefix_ void senf::StatisticsBase::OutputEntry::consoleList(std::ostream & os) -{ - for (boost::ptr_vector::iterator i (targets_.begin()); - i != targets_.end(); ++i) - if (! i->label.empty()) - os << i->label << "\n"; -} - -///////////////////////////////////////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// // senf::StatisticsBase prefix_ senf::StatisticsBase::StatisticsBase() @@ -146,7 +138,7 @@ prefix_ std::string senf::StatisticsBase::path() return v_path(); } -/////////////////////////////////////////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// // senf::Collector prefix_ senf::Collector::Collector(StatisticsBase * owner, unsigned rank) @@ -167,26 +159,38 @@ senf::Collector::output(unsigned n) return StatisticsBase::OutputProxy(this, StatisticsBase::output(n)); } -/////////////////////////////////////////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// // senf::Statistics +prefix_ void senf::Statistics::operator()(unsigned n, float min, float avg, float max, + float dev) +{ + enter(n, min, avg, max, dev); +} + prefix_ void senf::Statistics::operator()(float min, float avg, float max, float dev) { - enter(min, avg, max, dev); + enter(1, min, avg, max, dev); +} + +prefix_ void senf::Statistics::operator()(StatisticsData const & data) +{ + enter(1, data.min, data.avg, data.max, data.stddev); } prefix_ void senf::Statistics::operator()(float value, float dev) { - enter(value, value, value, dev); + enter(1, value, value, value, dev); } + prefix_ senf::StatisticsBase::OutputProxy senf::Statistics::output(unsigned n) { return StatisticsBase::OutputProxy(this, StatisticsBase::output(n)); } -///////////////////////////////cci.e/////////////////////////////////////// +//-///////////////////////////////////////////////////////////////////////////////////////////////// #undef prefix_