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& operator=(const ELstatistics& orig) = delete; // verboten
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  // ----- Methods invoked by the MessageLoggerScribe, bypassing destControl
73  //
74  public:
75  static void noteGroupedCategory(std::string const& cat); // 8/16/07 mf
76 
77  void summary(unsigned long overfullWaitCount);
78  void noTerminationSummary();
79  void summaryForJobReport(std::map<std::string, double>& sm);
80  void wipe() override;
81 
82  protected:
83  void clearSummary();
84 
85  void zero() override;
86 
87  std::map<ELextendedID, StatsCount> statisticsMap() const;
88 
89  protected:
93  std::ostream& termStream;
94 
96 
97  CMS_THREAD_SAFE static std::set<std::string> groupedCategories; // 8/16/07 mf
98  static std::string formSummary(ELmap_stats& stats); // 8/16/07 mf
99 
100  // ---- Helper methods specific to MessageLogger applicaton
101  //
102  private:
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
std::map< ELextendedID, StatsCount > statisticsMap() const
static std::set< std::string > groupedCategories
Definition: ELstatistics.h:97
std::string dualLogName(std::string const &s)
std::ostream & termStream
Definition: ELstatistics.h:93
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:286
HLT enums.
void summaryForJobReport(std::map< std::string, double > &sm)
static std::string formSummary(ELmap_stats &stats)
std::map< ELextendedID, StatsCount > ELmap_stats
Definition: ELmap.h:88