#include <EventFilter/Utilities/interface/TimeProfilerService.h>
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_ |
Classes | |
struct | times |
Definition at line 20 of file TimeProfilerService.h.
evf::TimeProfilerService::TimeProfilerService | ( | const edm::ParameterSet & | iPS, | |
edm::ActivityRegistry & | iRegistry | |||
) |
Definition at line 14 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().
00015 { 00016 iRegistry.watchPostBeginJob(this,&TimeProfilerService::postBeginJob); 00017 iRegistry.watchPostEndJob(this,&TimeProfilerService::postEndJob); 00018 00019 iRegistry.watchPreProcessEvent(this,&TimeProfilerService::preEventProcessing); 00020 iRegistry.watchPostProcessEvent(this,&TimeProfilerService::postEventProcessing); 00021 00022 iRegistry.watchPreModule(this,&TimeProfilerService::preModule); 00023 iRegistry.watchPostModule(this,&TimeProfilerService::postModule); 00024 }
evf::TimeProfilerService::~TimeProfilerService | ( | ) |
double evf::TimeProfilerService::getAve | ( | std::string const & | name | ) | const |
double evf::TimeProfilerService::getFirst | ( | std::string const & | name | ) | const |
double evf::TimeProfilerService::getMax | ( | std::string const & | name | ) | const |
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 44 of file TimeProfilerService.cc.
References curr_module_time_, evf::TimeProfilerService::times::firstEvent_, evf::getTime(), it, evf::TimeProfilerService::times::max_, edm::ModuleDescription::moduleLabel_, evf::TimeProfilerService::times::ncalls_, profiles_, t, evf::TimeProfilerService::times::total_, and tt.
Referenced by TimeProfilerService().
00045 { 00046 double t = getTime() - curr_module_time_; 00047 std::map<std::string, times>::iterator it = profiles_.find(desc.moduleLabel_); 00048 if(it==profiles_.end()) 00049 { 00050 times tt; 00051 tt.ncalls_ = 0; 00052 tt.total_ = 0.; 00053 tt.max_ = 0.; 00054 tt.firstEvent_ = t; 00055 profiles_.insert(std::pair<std::string, times>(desc.moduleLabel_,tt)); 00056 } 00057 else 00058 { 00059 (*it).second.ncalls_++; 00060 (*it).second.total_ += t; 00061 (*it).second.max_ = ((*it).second.max_ > t) ? (*it).second.max_ : t; 00062 } 00063 }
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 39 of file TimeProfilerService.cc.
References curr_module_time_, and evf::getTime().
Referenced by TimeProfilerService().
00040 { 00041 curr_module_time_ = getTime(); 00042 }
void evf::TimeProfilerService::preSource | ( | ) |
double evf::TimeProfilerService::curr_module_time_ [private] |
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().