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 
32 
33 #include <set>
34 
35 namespace edm {
36 
37  // ----------------------------------------------------------------------
38  // prerequisite classes:
39  // ----------------------------------------------------------------------
40 
41  class ErrorObj;
42  namespace service {
43  class ELadministrator;
44 
45  // ----------------------------------------------------------------------
46  // ELstatistics:
47  // ----------------------------------------------------------------------
48 
49  class ELstatistics : public ELdestination {
50  friend class ELadministrator;
51 
52  public:
53  // ----- constructor/destructor:
54  ELstatistics();
55  ELstatistics(std::ostream& osp);
56  ELstatistics(int spaceLimit);
57  ELstatistics(int spaceLimit, std::ostream& osp);
58  ELstatistics(const ELstatistics& orig);
59  ~ELstatistics() override;
60 
61  // ----- Methods invoked by the ELadministrator:
62  //
63  public:
64  // Used by attach() to put the destination on the ELadministrators list
65  //-| There is a note in Design Notes about semantics
66  //-| of copying a destination onto the list: ofstream
67  //-| ownership is passed to the new copy.
68 
69  bool log(const edm::ErrorObj& msg) override;
70 
71  // ----- Methods invoked by the MessageLoggerScribe, bypassing destControl
72  //
73  public:
74  static void noteGroupedCategory(std::string const& cat); // 8/16/07 mf
75 
76  void summary(unsigned long overfullWaitCount);
77  void noTerminationSummary();
78  void summaryForJobReport(std::map<std::string, double>& sm);
79  void wipe() override;
80 
81  protected:
82  void clearSummary();
83 
84  void zero() override;
85 
86  std::map<ELextendedID, StatsCount> statisticsMap() const;
87 
88  protected:
92  std::ostream& termStream;
93 
95 
96  CMS_THREAD_SAFE static std::set<std::string> groupedCategories; // 8/16/07 mf
97  static std::string formSummary(ELmap_stats& stats); // 8/16/07 mf
98 
99  // ---- Helper methods specific to MessageLogger applicaton
100  //
101  private:
103  ELstatistics& operator=(const ELstatistics& orig) = delete; // verboten
104 
105  void summary(std::ostream& os, std::string_view title);
106 
107  }; // ELstatistics
108 
109  // ----------------------------------------------------------------------
110 
111  } // end of namespace service
112 } // end of namespace edm
113 
114 #endif // FWCore_MessageService_ELstatistics_h
edm::service::ELstatistics::dualLogName
std::string dualLogName(std::string const &s)
Definition: ELstatistics.cc:466
service
Definition: service.py:1
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
edm::service::ELstatistics::noTerminationSummary
void noTerminationSummary()
Definition: ELstatistics.cc:359
edm::service::ELstatistics::~ELstatistics
~ELstatistics() override
Definition: ELstatistics.cc:138
edm::service::ELdestination
Definition: ELdestination.h:52
edm::service::ELstatistics::tableLimit
int tableLimit
Definition: ELstatistics.h:89
ELextendedID.h
edm
HLT enums.
Definition: AlignableModifier.h:19
eostools.cat
def cat(path)
Definition: eostools.py:401
edm::ErrorObj
Definition: ErrorObj.h:43
edm::service::ELstatistics::statisticsMap
std::map< ELextendedID, StatsCount > statisticsMap() const
Definition: ELstatistics.cc:361
mps_check.msg
tuple msg
Definition: mps_check.py:285
edm::service::ELstatistics::stats
ELmap_stats stats
Definition: ELstatistics.h:90
edm::ELmap_stats
std::map< ELextendedID, StatsCount > ELmap_stats
Definition: ELmap.h:88
edm::service::ELstatistics
Definition: ELstatistics.h:49
edm::service::ELstatistics::clearSummary
void clearSummary()
Definition: ELstatistics.cc:197
edm::service::ELstatistics::summary
void summary(unsigned long overfullWaitCount)
Definition: ELstatistics.cc:349
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::service::ELstatistics::noteGroupedCategory
static void noteGroupedCategory(std::string const &cat)
Definition: ELstatistics.cc:482
edm::service::ELadministrator
Definition: ELadministrator.h:66
edm::service::ELstatistics::termStream
std::ostream & termStream
Definition: ELstatistics.h:92
edm::service::ELstatistics::wipe
void wipe() override
Definition: ELstatistics.cc:207
CMS_THREAD_SAFE
#define CMS_THREAD_SAFE
Definition: thread_safety_macros.h:4
edm::service::ELstatistics::printAtTermination
bool printAtTermination
Definition: ELstatistics.h:94
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:366
edm::service::ELstatistics::ELstatistics
ELstatistics()
Definition: ELstatistics.cc:73
edm::service::ELstatistics::operator=
ELstatistics & operator=(const ELstatistics &orig)=delete
edm::service::ELstatistics::zero
void zero() override
Definition: ELstatistics.cc:213
edm::service::ELstatistics::log
bool log(const edm::ErrorObj &msg) override
Definition: ELstatistics.cc:152
edm::service::ELstatistics::formSummary
static std::string formSummary(ELmap_stats &stats)
Definition: ELstatistics.cc:215
edm::service::ELstatistics::groupedCategories
static std::set< std::string > groupedCategories
Definition: ELstatistics.h:96
edm::service::ELstatistics::updatedStats
bool updatedStats
Definition: ELstatistics.h:91