CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TimeProfilerService.h
Go to the documentation of this file.
1 #ifndef EvFTimeProfilerService_H
2 #define EvFTimeProfilerService_H 1
3 
4 
10 
11 #include "boost/thread/thread.hpp"
12 #include <sys/time.h>
13 
14 #include <string>
15 #include <vector>
16 #include <map>
17 
18 namespace evf {
19 
21  {
22  public:
25 
26  void postBeginJob();
27  void postEndJob();
28 
29  void preEventProcessing(const edm::EventID&, const edm::Timestamp&);
30  void postEventProcessing(const edm::Event&, const edm::EventSetup&);
31 
32  void preSource();
33  void postSource();
34 
35 
36  void preModule(const edm::ModuleDescription&);
38  double getFirst(std::string const &name) const;
39  double getMax(std::string const &name) const;
40  double getAve(std::string const &name) const;
41 
42  private:
43 
45  double curr_module_time_; // seconds
46  struct times{
47  double firstEvent_;
48  double max_;
49  double total_;
50  int ncalls_;
51  };
52  std::map<std::string, times> profiles_;
53  };
54 
55 }
56 
57 #endif
double getAve(std::string const &name) const
static boost::mutex mutex
Definition: LHEProxy.cc:11
TimeProfilerService(const edm::ParameterSet &, edm::ActivityRegistry &)
double getFirst(std::string const &name) const
void postEventProcessing(const edm::Event &, const edm::EventSetup &)
double getMax(std::string const &name) const
void preEventProcessing(const edm::EventID &, const edm::Timestamp &)
void postModule(const edm::ModuleDescription &)
std::map< std::string, times > profiles_
void preModule(const edm::ModuleDescription &)