CMS 3D CMS Logo

ELlimitsTable.h
Go to the documentation of this file.
1 #ifndef FWCore_MessageService_ELlimitsTable_h
2 #define FWCore_MessageService_ELlimitsTable_h
3 
4 // ----------------------------------------------------------------------
5 //
6 // ELlimitsTable is a class holding two maps: One listing various
7 // limits associated with each id, and one counting occurrences
8 // and tracking latest times of each type of extended-id
9 // (id + severity + module + subroutine + process).
10 // In addition, there is a table by severity of defaults,
11 // and a single wildcard default limit.
12 //
13 // The fundamental operation is
14 //
15 // bool add( const ELextendedID & )
16 //
17 // which checks if the extended id is in the main map. If it is not, it
18 // looks for the specified limit (by id, then severity, then wildcard) and
19 // cretes an entry in the main map for this extended id. The count is
20 // incremented, (perhaps zero-ed first if the timespan was exceeded) and
21 // checked against its limit. If the limit is not exceeded, OR is exceeded
22 // by 2**N times the limit, this returns true.
23 //
24 // Limits of -1 mean react to this error always.
25 // Limits of 0 in the auxilliary defaults indicate that the corresponding
26 // limit was not specified.
27 //
28 // 7/6/98 mf Created file.
29 // 6/7/00 web Reflect consolidation of ELdestination/X
30 // 6/14/00 web Declare classes before granting friendship.
31 // 6/15/01 mf Grant friendship to ELoutput so that faithful copying of
32 // ELoutput destinations becomes possible.
33 // 5/16/06 mf Added wildcardInterval member, and severityIntervals
34 //
35 // ----------------------------------------------------------------------
36 
40 
41 #include <string>
42 
43 namespace edm {
44  namespace service {
45 
46  // ----------------------------------------------------------------------
47  // Prerequisite class:
48  // ----------------------------------------------------------------------
49 
50  class ELdestination;
51  class ELoutput;
52 
53  // ----------------------------------------------------------------------
54  // ELlimitsTable:
55  // ----------------------------------------------------------------------
56 
57  class ELlimitsTable {
58  friend class ELdestination;
59  friend class ELoutput;
60 
61  public:
62  ELlimitsTable();
64 
65  // ----- Methods invoked by the destination under impetus from the logger:
66  //
67  public:
68  bool add(const ELextendedID& xid);
69  void setTableLimit(int n);
70 
71  // ----- Control methods invoked by the framework:
72  //
73  public:
74  void wipe(); // Clears everything -- counts and limits established.
75  void zero(); // Clears only counts.
76 
77  void setLimit(const std::string& id, int n);
78  void setLimit(const messagelogger::ELseverityLevel& sev, int n);
79  void setInterval(const std::string& id, int interval);
81  void setTimespan(const std::string& id, int n);
82  void setTimespan(const messagelogger::ELseverityLevel& sev, int n);
83 
85 
86  // ----- Tables and auxilliary private data:
87  //
88  protected:
95 
99 
100  }; // ELlimitsTable
101 
102  // ----------------------------------------------------------------------
103 
104  } // end of namespace service
105 } // end of namespace edm
106 
107 #endif // FWCore_MessageService_ELlimitsTable_h
service
Definition: service.py:1
edm::service::ELoutput
Definition: ELoutput.h:43
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
edm::service::ELdestination
Definition: ELdestination.h:52
ELextendedID.h
edm::ELmap_counts
std::map< ELextendedID, CountAndLimit > ELmap_counts
Definition: ELmap.h:86
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::service::ELlimitsTable::setTimespan
void setTimespan(const std::string &id, int n)
Definition: ELlimitsTable.cc:218
ELseverityLevel.h
edm::service::ELlimitsTable::operator=
ELlimitsTable & operator=(const ELlimitsTable &t)
Definition: ELlimitsTable.cc:233
edm::ELextendedID
Definition: ELextendedID.h:25
edm::service::ELlimitsTable::severityIntervals
int severityIntervals[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:91
edm::ELmap_limits
std::map< std::string, LimitAndTimespan > ELmap_limits
Definition: ELmap.h:84
edm::service::ELlimitsTable::wipe
void wipe()
Definition: ELlimitsTable.cc:165
edm::service::ELlimitsTable::severityLimits
int severityLimits[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:89
edm::service::ELlimitsTable::wildcardTimespan
int wildcardTimespan
Definition: ELlimitsTable.h:94
edm::service::ELlimitsTable::~ELlimitsTable
~ELlimitsTable()
Definition: ELlimitsTable.cc:52
edm::service::ELlimitsTable
Definition: ELlimitsTable.h:57
edm::messagelogger::ELseverityLevel::nLevels
Definition: ELseverityLevel.h:43
ELmap.h
edm::service::ELlimitsTable::setInterval
void setInterval(const std::string &id, int interval)
Definition: ELlimitsTable.cc:207
edm::service::ELlimitsTable::add
bool add(const ELextendedID &xid)
Definition: ELlimitsTable.cc:65
edm::service::ELlimitsTable::setTableLimit
void setTableLimit(int n)
Definition: ELlimitsTable.cc:63
edm::service::ELlimitsTable::limits
ELmap_limits limits
Definition: ELlimitsTable.h:97
edm::service::ELlimitsTable::wildcardInterval
int wildcardInterval
Definition: ELlimitsTable.h:93
readEcalDQMStatus.interval
interval
Definition: readEcalDQMStatus.py:18
edm::service::ELlimitsTable::tableLimit
int tableLimit
Definition: ELlimitsTable.h:96
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::service::ELlimitsTable::wildcardLimit
int wildcardLimit
Definition: ELlimitsTable.h:92
edm::service::ELlimitsTable::zero
void zero()
Definition: ELlimitsTable.cc:187
edm::service::ELlimitsTable::setLimit
void setLimit(const std::string &id, int n)
Definition: ELlimitsTable.cc:196
edm::messagelogger::ELseverityLevel
Definition: ELseverityLevel.h:26
edm::service::ELlimitsTable::counts
ELmap_counts counts
Definition: ELlimitsTable.h:98
edm::service::ELlimitsTable::severityTimespans
int severityTimespans[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:90
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::service::ELlimitsTable::ELlimitsTable
ELlimitsTable()
Definition: ELlimitsTable.cc:38