CMS 3D CMS Logo

Classes | Public Member Functions | Private Attributes

evf::TimeProfilerService Class Reference

#include <TimeProfilerService.h>

List of all members.

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, timesprofiles_

Detailed Description

Definition at line 20 of file TimeProfilerService.h.


Constructor & Destructor Documentation

evf::TimeProfilerService::TimeProfilerService ( const edm::ParameterSet iPS,
edm::ActivityRegistry iRegistry 
)
evf::TimeProfilerService::~TimeProfilerService ( )

Definition at line 27 of file TimeProfilerService.cc.

  {}

Member Function Documentation

double evf::TimeProfilerService::getAve ( std::string const &  name) const

Definition at line 83 of file TimeProfilerService.cc.

References profiles_.

Referenced by evf::FWEPWrapper::taskWebPage().

  {
    std::map<std::string, times>::const_iterator it = profiles_.find(name);

    if(it == profiles_.end())
      return -1.;
    return (*it).second.total_/(*it).second.ncalls_;
  }
double evf::TimeProfilerService::getFirst ( std::string const &  name) const

Definition at line 65 of file TimeProfilerService.cc.

References profiles_.

Referenced by evf::FWEPWrapper::taskWebPage().

  {
    std::map<std::string, times>::const_iterator it = profiles_.find(name);

    if(it==profiles_.end())
      return -1.;
    return (*it).second.firstEvent_;
  }
double evf::TimeProfilerService::getMax ( std::string const &  name) const

Definition at line 74 of file TimeProfilerService.cc.

References profiles_.

Referenced by evf::FWEPWrapper::taskWebPage().

  {
    std::map<std::string, times>::const_iterator it = profiles_.find(name);

    if(it == profiles_.end())
      return -1.;
    return (*it).second.max_;
  }
void evf::TimeProfilerService::postBeginJob ( )

Definition at line 30 of file TimeProfilerService.cc.

Referenced by TimeProfilerService().

  {}
void evf::TimeProfilerService::postEndJob ( )

Definition at line 33 of file TimeProfilerService.cc.

Referenced by TimeProfilerService().

  {}
void evf::TimeProfilerService::postEventProcessing ( const edm::Event e,
const edm::EventSetup  
)

Definition at line 38 of file TimeProfilerService.cc.

Referenced by TimeProfilerService().

  {}
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_, lumiQTWidget::t, evf::TimeProfilerService::times::total_, and groupFilesInBlocks::tt.

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 
)

Definition at line 35 of file TimeProfilerService.cc.

Referenced by TimeProfilerService().

  {}
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().

void evf::TimeProfilerService::preSource ( )

Member Data Documentation

Definition at line 45 of file TimeProfilerService.h.

Referenced by postModule(), and preModule().

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().