#include <cstdlib>
#include <sstream>
#include <senf/Utils/Format.hh>
+#include <senf/Utils/Console/STLSupport.hh>
#include "StatisticsTargets.hh"
//#include "Statistics.mpp"
#define prefix_
-///////////////////////////////cc.p////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
// senf::StatisticsBase
prefix_ void senf::StatisticsBase::enter(unsigned n, float min, float avg, float max, float dev)
}
}
-///////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
+// senf::StatisticsBase::OutputEntry
+
+prefix_ void senf::StatisticsBase::OutputEntry::consoleList(std::ostream & os)
+{
+ for (boost::ptr_vector<TargetBase>::iterator i (targets_.begin());
+ i != targets_.end(); ++i)
+ if (! i->label.empty())
+ os << i->label << "\n";
+}
+
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
// senf::Statistics
prefix_ senf::Statistics::Statistics()
#endif
{
#ifndef SENF_DISABLE_CONSOLE
- namespace fty = senf::console::factory;
+ namespace fty = console::factory;
dir.add("list", fty::Command(&Statistics::consoleList, this)
.doc("List statistics collection intervals and current values.\n"
"the last 5 minutes.")
.arg("rank","Rank chain selecting the value to generate output for")
.arg("window","Optional size of sliding average window",
- senf::console::kw::default_value = 1u) );
+ console::kw::default_value = 1u) );
#endif
}
return "";
}
-///////////////////////////////////////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
// senf::Collector
prefix_ void senf::Collector::enter(unsigned n, float min, float avg, float max, float dev)
return owner_->path() + "-" + senf::str(rank_);
}
-///////////////////////////////cc.e////////////////////////////////////////
+//-/////////////////////////////////////////////////////////////////////////////////////////////////
#undef prefix_
//#include "Statistics.mpp"