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
static std::set< std::string > groupedCategories
Definition: ELstatistics.h:103
std::map< ELextendedID, StatsCount > statisticsMap() const
std::string dualLogName(std::string const &s)
std::ostream & termStream
Definition: ELstatistics.h:99
static ELstring formSummary(ELmap_stats &stats)
void summary(unsigned long overfullWaitCount)
def cat(path)
Definition: eostools.py:401
ELstatistics & operator=(const ELstatistics &orig)=delete
#define CMS_THREAD_SAFE
static void noteGroupedCategory(std::string const &cat)
bool log(const edm::ErrorObj &msg) override
tuple msg
Definition: mps_check.py:279
HLT enums.
void summaryForJobReport(std::map< std::string, double > &sm)
std::string ELstring
Definition: ELstring.h:21
std::map< ELextendedID, StatsCount > ELmap_stats
Definition: ELmap.h:88