#include <TimeProfilerService.h>
Classes | |
struct | times |
Public Member Functions | |
double | getAve (std::string const &name) const |
double | getFirst (std::string const &name) const |
double | getMax (std::string const &name) const |
void | postBeginJob () |
void | postEndJob () |
void | postEventProcessing (const edm::Event &, const edm::EventSetup &) |
void | postModule (const edm::ModuleDescription &) |
void | postSource () |
void | preEventProcessing (const edm::EventID &, const edm::Timestamp &) |
void | preModule (const edm::ModuleDescription &) |
void | preSource () |
TimeProfilerService (const edm::ParameterSet &, edm::ActivityRegistry &) | |
~TimeProfilerService () | |
Private Attributes | |
double | curr_module_time_ |
boost::mutex | lock_ |
std::map< std::string, times > | profiles_ |
Definition at line 20 of file TimeProfilerService.h.
evf::TimeProfilerService::TimeProfilerService | ( | const edm::ParameterSet & | iPS, |
edm::ActivityRegistry & | iRegistry | ||
) |
Definition at line 15 of file TimeProfilerService.cc.
References postBeginJob(), postEndJob(), postEventProcessing(), postModule(), preEventProcessing(), preModule(), edm::ActivityRegistry::watchPostBeginJob(), edm::ActivityRegistry::watchPostEndJob(), edm::ActivityRegistry::watchPostModule(), edm::ActivityRegistry::watchPostProcessEvent(), edm::ActivityRegistry::watchPreModule(), and edm::ActivityRegistry::watchPreProcessEvent().
{ iRegistry.watchPostBeginJob(this,&TimeProfilerService::postBeginJob); iRegistry.watchPostEndJob(this,&TimeProfilerService::postEndJob); iRegistry.watchPreProcessEvent(this,&TimeProfilerService::preEventProcessing); iRegistry.watchPostProcessEvent(this,&TimeProfilerService::postEventProcessing); iRegistry.watchPreModule(this,&TimeProfilerService::preModule); iRegistry.watchPostModule(this,&TimeProfilerService::postModule); }
evf::TimeProfilerService::~TimeProfilerService | ( | ) |
Definition at line 27 of file TimeProfilerService.cc.
{}
double evf::TimeProfilerService::getAve | ( | std::string const & | name | ) | const |
Definition at line 83 of file TimeProfilerService.cc.
References profiles_.
Referenced by evf::FWEPWrapper::taskWebPage().
double evf::TimeProfilerService::getFirst | ( | std::string const & | name | ) | const |
Definition at line 65 of file TimeProfilerService.cc.
References profiles_.
Referenced by evf::FWEPWrapper::taskWebPage().
double evf::TimeProfilerService::getMax | ( | std::string const & | name | ) | const |
Definition at line 74 of file TimeProfilerService.cc.
References profiles_.
Referenced by evf::FWEPWrapper::taskWebPage().
void evf::TimeProfilerService::postBeginJob | ( | ) |
void evf::TimeProfilerService::postEndJob | ( | ) |
void evf::TimeProfilerService::postEventProcessing | ( | const edm::Event & | e, |
const edm::EventSetup & | |||
) |
void evf::TimeProfilerService::postModule | ( | const edm::ModuleDescription & | desc | ) |
Definition at line 45 of file TimeProfilerService.cc.
References curr_module_time_, evf::TimeProfilerService::times::firstEvent_, evf::getTime(), evf::TimeProfilerService::times::max_, edm::ModuleDescription::moduleLabel(), evf::TimeProfilerService::times::ncalls_, profiles_, matplotRender::t, and evf::TimeProfilerService::times::total_.
Referenced by TimeProfilerService().
{ double t = getTime() - curr_module_time_; std::map<std::string, times>::iterator it = profiles_.find(desc.moduleLabel()); if(it==profiles_.end()) { times tt; tt.ncalls_ = 0; tt.total_ = 0.; tt.max_ = 0.; tt.firstEvent_ = t; profiles_.insert(std::pair<std::string, times>(desc.moduleLabel(),tt)); } else { (*it).second.ncalls_++; (*it).second.total_ += t; (*it).second.max_ = ((*it).second.max_ > t) ? (*it).second.max_ : t; } }
void evf::TimeProfilerService::postSource | ( | ) |
void evf::TimeProfilerService::preEventProcessing | ( | const edm::EventID & | iID, |
const edm::Timestamp & | iTime | ||
) |
void evf::TimeProfilerService::preModule | ( | const edm::ModuleDescription & | ) |
Definition at line 40 of file TimeProfilerService.cc.
References curr_module_time_, and evf::getTime().
Referenced by TimeProfilerService().
{ curr_module_time_ = getTime(); }
void evf::TimeProfilerService::preSource | ( | ) |
double evf::TimeProfilerService::curr_module_time_ [private] |
Definition at line 45 of file TimeProfilerService.h.
Referenced by postModule(), and preModule().
boost::mutex evf::TimeProfilerService::lock_ [private] |
Definition at line 44 of file TimeProfilerService.h.
std::map<std::string, times> evf::TimeProfilerService::profiles_ [private] |
Definition at line 52 of file TimeProfilerService.h.
Referenced by getAve(), getFirst(), getMax(), and postModule().