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