#include <TimingReport.h>
Classes | |
class | Item |
Public Types | |
typedef BaseEvent< std::pair < double, double > > | ItemObserver |
Public Member Functions | |
void | dump (std::ostream &co, bool active=false) |
bool & | inTicks () |
report in ticks | |
const bool & | isOn () const |
Item & | make (const std::string &name) |
const Item & | operator[] (const std::string &name) const |
Item & | operator[] (const std::string &name) |
void | start (const std::string &name) |
void | stop (const std::string &name) |
void | switchOn (bool ion) |
switch all on | |
void | switchOn (const std::string &name, bool ion) |
switch one ion | |
~TimingReport () | |
Static Public Member Functions | |
static TimingReport * | current () |
Protected Types | |
typedef std::map< std::string, Item, std::less< std::string > > | SMAP |
Protected Member Functions | |
TimingReport () | |
Private Attributes | |
bool | inTicks_ |
bool | on |
SMAP | registry |
Definition at line 22 of file TimingReport.h.
typedef BaseEvent< std::pair<double,double> > TimingReport::ItemObserver |
Definition at line 24 of file TimingReport.h.
typedef std::map< std::string, Item, std::less<std::string> > TimingReport::SMAP [protected] |
Definition at line 63 of file TimingReport.h.
TimingReport::TimingReport | ( | ) | [protected] |
Definition at line 29 of file TimingReport.cc.
Referenced by current().
TimingReport::~TimingReport | ( | ) |
Definition at line 45 of file TimingReport.cc.
References gather_cfg::cout, dump(), and on.
TimingReport * TimingReport::current | ( | ) | [static] |
Definition at line 21 of file TimingReport.cc.
References TimingReport().
Referenced by TimerStack::push(), and HTimerStack::push().
{ static TimingReport * currentTimingReport=0; if (currentTimingReport==0) currentTimingReport = new TimingReport(); return currentTimingReport; }
void TimingReport::dump | ( | std::ostream & | co, |
bool | active = false |
||
) |
make the output sorted
Definition at line 50 of file TimingReport.cc.
References inTicks(), max(), AlCaHLTBitMon_ParallelJobs::p, registry, and GenTimer< PentiumTime >::ticksInSec().
Referenced by ~TimingReport().
{ typedef std::map<std::string, Item *, std::less<std::string> > LMAP; LMAP lreg; { SMAP::iterator p = registry.begin(); SMAP::iterator e = registry.end(); while (p!=e) { if ( (*p).second.on && (!active||(*p).second.active()) ) lreg[(*p).first] = &(*p).second; ++p; } } std::ostream co(ico.rdbuf()); size_t namew = 20; co << "\n"; if (active) co << "Active "; co << "Timing Report (in " << (inTicks() ? "ticks" : "seconds") << ")\n" << std::endl; LMAP::iterator p = lreg.begin(); LMAP::iterator e = lreg.end(); while (p!=e) { namew = std::max(namew,(*p).first.size()); ++p;} p = lreg.begin(); while (p!=e) { co.setf(std::ios::left,std::ios::adjustfield); if (inTicks()) co << std::setiosflags(std::ios::showpoint) << std::setprecision(3); else co << std::setiosflags(std::ios::showpoint | std::ios::fixed) << std::setprecision(3); co << std::setw(namew) << (*p).first.c_str() << " "; co.setf(std::ios::right,std::ios::adjustfield); co << std::setw(10) << (*(*p).second).counter << " "; co << std::setw(10) << (inTicks() ? (*(*p).second).realticks() : (*(*p).second).realsec() ) << " (real)"; #ifdef __linux__ co << " " << std::setw(10) << (inTicks() ? 1./PentiumTimer::ticksInSec() : 1.)*(*(*p).second).cpusec() << " (cpu)"; #endif co << std::endl; ++p; } co << "\n" << std::endl; }
bool& TimingReport::inTicks | ( | ) | [inline] |
report in ticks
Definition at line 74 of file TimingReport.h.
References inTicks_.
Referenced by dump().
{ return inTicks_;}
const bool& TimingReport::isOn | ( | ) | const [inline] |
Item& TimingReport::make | ( | const std::string & | name | ) | [inline] |
Definition at line 103 of file TimingReport.h.
References mergeVDriftHistosByStation::name, on, and registry.
Referenced by operator[]().
Item& TimingReport::operator[] | ( | const std::string & | name | ) | [inline] |
const Item& TimingReport::operator[] | ( | const std::string & | name | ) | const [inline] |
Definition at line 97 of file TimingReport.h.
References AlCaHLTBitMon_ParallelJobs::p, and registry.
void TimingReport::start | ( | const std::string & | name | ) | [inline] |
Definition at line 84 of file TimingReport.h.
References mergeVDriftHistosByStation::name, on, and registry.
void TimingReport::stop | ( | const std::string & | name | ) | [inline] |
Definition at line 87 of file TimingReport.h.
References mergeVDriftHistosByStation::name, on, and registry.
void TimingReport::switchOn | ( | const std::string & | name, |
bool | ion | ||
) | [inline] |
switch one ion
Definition at line 80 of file TimingReport.h.
References mergeVDriftHistosByStation::name, and registry.
void TimingReport::switchOn | ( | bool | ion | ) |
switch all on
Definition at line 35 of file TimingReport.cc.
References on, AlCaHLTBitMon_ParallelJobs::p, and registry.
bool TimingReport::inTicks_ [private] |
Definition at line 112 of file TimingReport.h.
Referenced by inTicks().
bool TimingReport::on [private] |
Definition at line 111 of file TimingReport.h.
Referenced by isOn(), make(), start(), stop(), switchOn(), and ~TimingReport().
SMAP TimingReport::registry [private] |
Definition at line 113 of file TimingReport.h.
Referenced by dump(), make(), operator[](), start(), stop(), and switchOn().