CMS 3D CMS Logo

ELstatistics.h
Go to the documentation of this file.
1 #ifndef FWCore_MessageService_ELstatistics_h
2 #define FWCore_MessageService_ELstatistics_h
3 
4 // ----------------------------------------------------------------------
5 //
6 // ELstatistics is a subclass of ELdestination representing the
7 // provided statistics (for summary) keeping.
8 //
9 // 7/8/98 mf Created file.
10 // 7/2/99 jvr Added noTerminationSummary() function
11 // 12/20/99 mf Added virtual destructor.
12 // 6/7/00 web Reflect consolidation of ELdestination/X; consolidate
13 // ELstatistics/X.
14 // 6/14/00 web Declare classes before granting friendship.
15 // 10/4/00 mf Add filterModule() and excludeModule()
16 // 1/15/00 mf line length control: changed ELoutputLineLen to
17 // the base class lineLen (no longer static const)
18 // 3/13/01 mf statisticsMap()
19 // 4/4/01 mf Removed moduleOfInterest and moduleToExclude, in favor
20 // of using base class method.
21 // 1/17/06 mf summary() for use in MessageLogger
22 // 8/16/07 mf noteGroupedCategory(cat) to support grouping of modules in
23 // specified categories. Also, a static vector of such categories.
24 // 6/19/08 mf summaryForJobReport() for use in CMS framework
25 //
26 // ----------------------------------------------------------------------
27 
33 
34 #include <set>
35 
36 namespace edm {
37 
38  // ----------------------------------------------------------------------
39  // prerequisite classes:
40  // ----------------------------------------------------------------------
41 
42  class ErrorObj;
43  namespace service {
44  class ELadministrator;
45 
46  // ----------------------------------------------------------------------
47  // ELstatistics:
48  // ----------------------------------------------------------------------
49 
50  class ELstatistics : public ELdestination {
51  friend class ELadministrator;
52 
53  public:
54  // ----- constructor/destructor:
55  ELstatistics();
56  ELstatistics(std::ostream& osp);
57  ELstatistics(int spaceLimit);
58  ELstatistics(int spaceLimit, std::ostream& osp);
59  ELstatistics(const ELstatistics& orig);
60  ~ELstatistics() override;
61 
62  // ----- Methods invoked by the ELadministrator:
63  //
64  public:
65  // Used by attach() to put the destination on the ELadministrators list
66  //-| There is a note in Design Notes about semantics
67  //-| of copying a destination onto the list: ofstream
68  //-| ownership is passed to the new copy.
69 
70  bool log(const edm::ErrorObj& msg) override;
71 
72  // output( const ELstring & item, const ELseverityLevel & sev )
73  // from base class
74 
75  // ----- Methods invoked by the MessageLoggerScribe, bypassing destControl
76  //
77  public:
78  static void noteGroupedCategory(std::string const& cat); // 8/16/07 mf
79 
80  void summary(unsigned long overfullWaitCount);
81  void noTerminationSummary();
82  void summaryForJobReport(std::map<std::string, double>& sm);
83  void wipe() override;
84 
85  protected:
86  void clearSummary();
87 
88  void zero() override;
89 
90  std::map<ELextendedID, StatsCount> statisticsMap() const;
91 
92  // summarization( const ELstring & sumLines, const ELstring & sumLines )
93  // from base class
94 
95  protected:
99  std::ostream& termStream;
100 
102 
103  CMS_THREAD_SAFE static std::set<std::string> groupedCategories; // 8/16/07 mf
104  static ELstring formSummary(ELmap_stats& stats); // 8/16/07 mf
105 
106  // ---- Helper methods specific to MessageLogger applicaton
107  //
108  private:
110  ELstatistics& operator=(const ELstatistics& orig) = delete; // verboten
111 
112  void summary(std::ostream& os, const ELstring& title);
113 
114  }; // ELstatistics
115 
116  // ----------------------------------------------------------------------
117 
118  } // end of namespace service
119 } // end of namespace edm
120 
121 #endif // FWCore_MessageService_ELstatistics_h
edm::service::ELstatistics::dualLogName
std::string dualLogName(std::string const &s)
Definition: ELstatistics.cc:464
service
Definition: service.py:1
edm::service::ELstatistics::noTerminationSummary
void noTerminationSummary()
Definition: ELstatistics.cc:357
edm::service::ELstatistics::~ELstatistics
~ELstatistics() override
Definition: ELstatistics.cc:113
edm::service::ELdestination
Definition: ELdestination.h:53
edm::service::ELstatistics::tableLimit
int tableLimit
Definition: ELstatistics.h:96
ELextendedID.h
edm::service::ELstatistics::formSummary
static ELstring formSummary(ELmap_stats &stats)
Definition: ELstatistics.cc:213
edm
HLT enums.
Definition: AlignableModifier.h:19
eostools.cat
def cat(path)
Definition: eostools.py:401
edm::ErrorObj
Definition: ErrorObj.h:44
edm::service::ELstatistics::statisticsMap
std::map< ELextendedID, StatsCount > statisticsMap() const
Definition: ELstatistics.cc:359
mps_check.msg
tuple msg
Definition: mps_check.py:285
edm::service::ELstatistics::stats
ELmap_stats stats
Definition: ELstatistics.h:97
edm::ELmap_stats
std::map< ELextendedID, StatsCount > ELmap_stats
Definition: ELmap.h:88
edm::service::ELstatistics
Definition: ELstatistics.h:50
edm::service::ELstatistics::clearSummary
void clearSummary()
Definition: ELstatistics.cc:195
edm::service::ELstatistics::summary
void summary(unsigned long overfullWaitCount)
Definition: ELstatistics.cc:347
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::ELstring
std::string ELstring
Definition: ELstring.h:21
edm::service::ELstatistics::noteGroupedCategory
static void noteGroupedCategory(std::string const &cat)
Definition: ELstatistics.cc:480
edm::service::ELadministrator
Definition: ELadministrator.h:75
edm::service::ELstatistics::termStream
std::ostream & termStream
Definition: ELstatistics.h:99
edm::service::ELstatistics::wipe
void wipe() override
Definition: ELstatistics.cc:205
CMS_THREAD_SAFE
#define CMS_THREAD_SAFE
Definition: thread_safety_macros.h:4
edm::service::ELstatistics::printAtTermination
bool printAtTermination
Definition: ELstatistics.h:101
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ELmap.h
ELdestination.h
thread_safety_macros.h
edm::service::ELstatistics::summaryForJobReport
void summaryForJobReport(std::map< std::string, double > &sm)
Definition: ELstatistics.cc:364
overlapproblemtsosanalyzer_cfi.title
title
Definition: overlapproblemtsosanalyzer_cfi.py:7
edm::service::ELstatistics::ELstatistics
ELstatistics()
Definition: ELstatistics.cc:48
edm::service::ELstatistics::operator=
ELstatistics & operator=(const ELstatistics &orig)=delete
edm::service::ELstatistics::zero
void zero() override
Definition: ELstatistics.cc:211
edm::service::ELstatistics::log
bool log(const edm::ErrorObj &msg) override
Definition: ELstatistics.cc:150
ELstring.h
edm::service::ELstatistics::groupedCategories
static std::set< std::string > groupedCategories
Definition: ELstatistics.h:103
edm::service::ELstatistics::updatedStats
bool updatedStats
Definition: ELstatistics.h:98