CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes | Friends
edm::service::ELlimitsTable Class Reference

#include <ELlimitsTable.h>

Public Member Functions

bool add (const ELextendedID &xid)
 
 ELlimitsTable ()
 
ELlimitsTableoperator= (const ELlimitsTable &t)
 
void setInterval (const std::string &id, int interval)
 
void setInterval (const messagelogger::ELseverityLevel &sev, int interval)
 
void setLimit (const std::string &id, int n)
 
void setLimit (const messagelogger::ELseverityLevel &sev, int n)
 
void setTableLimit (int n)
 
void setTimespan (const std::string &id, int n)
 
void setTimespan (const messagelogger::ELseverityLevel &sev, int n)
 
void wipe ()
 
void zero ()
 
 ~ELlimitsTable ()
 

Protected Attributes

ELmap_counts counts
 
ELmap_limits limits
 
int severityIntervals [messagelogger::ELseverityLevel::nLevels]
 
int severityLimits [messagelogger::ELseverityLevel::nLevels]
 
int severityTimespans [messagelogger::ELseverityLevel::nLevels]
 
int tableLimit
 
int wildcardInterval
 
int wildcardLimit
 
int wildcardTimespan
 

Friends

class ELdestination
 
class ELoutput
 

Detailed Description

Definition at line 57 of file ELlimitsTable.h.

Constructor & Destructor Documentation

◆ ELlimitsTable()

edm::service::ELlimitsTable::ELlimitsTable ( )

Definition at line 38 of file ELlimitsTable.cc.

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, dqmdumpme::k, edm::messagelogger::ELseverityLevel::nLevels, severityIntervals, severityLimits, and severityTimespans.

40 #ifdef ELlimitsTableCONSTRUCTOR_TRACE
41  std::cerr << "Constructor for ELlimitsTable\n";
42 #endif
43 
44  for (int k = 0; k < messagelogger::ELseverityLevel::nLevels; ++k) {
45  severityLimits[k] = -1; // JvR 99-06-10
46  severityIntervals[k] = -1;
47  severityTimespans[k] = -1;
48  }
49 
50  } // ELlimitsTable()
int severityIntervals[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:91
int severityTimespans[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:90
int severityLimits[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:89

◆ ~ELlimitsTable()

edm::service::ELlimitsTable::~ELlimitsTable ( )

Definition at line 52 of file ELlimitsTable.cc.

References EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr.

52  {
53 #ifdef ELlimitsTableCONSTRUCTOR_TRACE
54  std::cerr << "Destructor for ELlimitsTable\n";
55 #endif
56 
57  } // ~ELlimitsTable()

Member Function Documentation

◆ add()

bool edm::service::ELlimitsTable::add ( const ELextendedID xid)

Definition at line 65 of file ELlimitsTable.cc.

References c, EcnaPython_AdcPeg12_S1_10_R170298_1_0_150_Dee0::cerr, counts, edm::messagelogger::ELseverityLevel::getLevel(), edm::ELextendedID::id, MainPageGenerator::l, limits, edm::ELextendedID::severity, severityIntervals, severityLimits, severityTimespans, tableLimit, wildcardInterval, wildcardLimit, and wildcardTimespan.

Referenced by edm::service::ELoutput::log(), counter.Counter::register(), SequenceTypes._TaskBase::remove(), and SequenceTypes._TaskBase::replace().

65  {
66 #ifdef ELlimitsTableATRACE
67  std::cerr << "&&&--- adding to limits table: " << xid.id << '\n';
68 #endif
69 
70  ELmap_counts::iterator c = counts.find(xid);
71 
72  if (c == counts.end()) { // no such entry yet
73 
74 #ifdef ELlimitsTableATRACE
75  std::cerr << "&&& no such entry yet in counts \n";
76 #endif
77 
78  // if the counts table is "full", then this will never be rejected
79  // and info will not be kept so why go through significant work:
80  if (tableLimit > 0 && static_cast<int>(counts.size()) >= tableLimit) {
81  return true;
82  }
83  int lim;
84  int ivl;
85  int ts;
86  ELmap_limits::iterator l = limits.find(xid.id);
87 
88  if (l != limits.end()) { // use limits previously established for this id
89  lim = (*l).second.limit;
90  ivl = (*l).second.interval;
91  ts = (*l).second.timespan;
92  if (lim < 0) { // jvr 6/17/99
93  lim = severityLimits[xid.severity.getLevel()];
94  if (lim < 0) {
95  lim = wildcardLimit;
96  }
97  }
98  if (ivl < 0) {
99  ivl = severityIntervals[xid.severity.getLevel()];
100  if (ivl < 0) {
101  ivl = wildcardInterval; // mf 11/02/07
102  }
103  }
104  if (ts < 0) {
105  ts = severityTimespans[xid.severity.getLevel()];
106  if (ts < 0) {
107  ts = wildcardTimespan;
108  }
109  limits[xid.id] = LimitAndTimespan(lim, ts);
110  }
111 #ifdef ELlimitsTableATRACE
112  std::cerr << "&&& Entry found in limits: limit = " << lim << " interval = " << ivl << " timespan = " << ts
113  << '\n';
114 #endif
115  // change log 9/29/10: Do not put this into limits table
116  } else { // establish and use limits new to this id
117  lim = severityLimits[xid.severity.getLevel()];
118  ivl = severityIntervals[xid.severity.getLevel()];
119  ts = severityTimespans[xid.severity.getLevel()];
120 #ifdef ELlimitsTableATRACE
121  std::cerr << "&&& Limit taken from severityLimits: " << lim << '\n'
122  << "&&& Interval taken from severityLimits: " << ivl << '\n';
123 #endif
124  if (lim < 0) {
125  lim = wildcardLimit;
126 #ifdef ELlimitsTableATRACE
127  std::cerr << "&&& Limit reset to wildcard limit: " << lim << '\n';
128 #endif
129  }
130  if (ivl < 0) {
131  ivl = wildcardInterval;
132 #ifdef ELlimitsTableATRACE
133  std::cerr << "&&& Interval reset to wildcard interval: " << ivl << '\n';
134 #endif
135  }
136 #ifdef ELlimitsTableATRACE
137  std::cerr << "&&& Timespan taken from severityTimespans: " << ts << '\n';
138 #endif
139  if (ts < 0) {
140  ts = wildcardTimespan;
141 #ifdef ELlimitsTableATRACE
142  std::cerr << "&&& timespan reset to wildcard timespan: " << ts << '\n';
143 #endif
144  }
145 
146  // change log 9/29/10 DO not save id's future limits:
147  }
148 
149  // save, if possible, this xid's initial entry:
150  if (tableLimit < 0 || static_cast<int>(counts.size()) < tableLimit)
151  counts[xid] = CountAndLimit(lim, ts, ivl);
152  c = counts.find(xid);
153  }
154 
155  return (c == counts.end()) ? true // no limit filtering can be applied
156  : (*c).second.add() // apply limit filtering
157  ;
158 
159  } // add()
int severityIntervals[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:91
int severityTimespans[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:90
int severityLimits[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:89

◆ operator=()

ELlimitsTable & edm::service::ELlimitsTable::operator= ( const ELlimitsTable t)

Definition at line 233 of file ELlimitsTable.cc.

References limits, edm::messagelogger::ELseverityLevel::nLevels, severityTimespans, submitPVValidationJobs::t, wildcardLimit, and wildcardTimespan.

233  {
234  if (this == &t) {
235  return *this; // self assignment
236  }
237  limits = t.limits; // The non-trivial operator= for a map!
238 
239  for (int lev = 0; lev < messagelogger::ELseverityLevel::nLevels; ++lev) {
240  severityTimespans[lev] = t.severityTimespans[lev];
241  severityTimespans[lev] = t.severityTimespans[lev];
242  }
243 
244  wildcardLimit = t.wildcardLimit;
245  wildcardTimespan = t.wildcardTimespan;
246 
247  return *this;
248 
249  } // operator=()
int severityTimespans[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:90

◆ setInterval() [1/2]

void edm::service::ELlimitsTable::setInterval ( const std::string &  id,
int  interval 
)

◆ setInterval() [2/2]

void edm::service::ELlimitsTable::setInterval ( const messagelogger::ELseverityLevel sev,
int  interval 
)

Definition at line 214 of file ELlimitsTable.cc.

References edm::messagelogger::ELseverityLevel::getLevel(), writeEcalDQMStatus::interval, and severityIntervals.

214  {
215  severityIntervals[sev.getLevel()] = interval;
216  }
int severityIntervals[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:91

◆ setLimit() [1/2]

void edm::service::ELlimitsTable::setLimit ( const std::string &  id,
int  n 
)

Definition at line 196 of file ELlimitsTable.cc.

References triggerObjects_cff::id, limits, dqmiodumpmetadata::n, and wildcardLimit.

Referenced by edm::service::ELdestination::setLimit().

196  {
197  if (id[0] == '*')
198  wildcardLimit = n;
199  else
200  limits[id].limit = n;
201  }

◆ setLimit() [2/2]

void edm::service::ELlimitsTable::setLimit ( const messagelogger::ELseverityLevel sev,
int  n 
)

Definition at line 203 of file ELlimitsTable.cc.

References edm::messagelogger::ELseverityLevel::getLevel(), dqmiodumpmetadata::n, and severityLimits.

203  {
204  severityLimits[sev.getLevel()] = n;
205  }
int severityLimits[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:89

◆ setTableLimit()

void edm::service::ELlimitsTable::setTableLimit ( int  n)

◆ setTimespan() [1/2]

void edm::service::ELlimitsTable::setTimespan ( const std::string &  id,
int  n 
)

Definition at line 218 of file ELlimitsTable.cc.

References triggerObjects_cff::id, limits, dqmiodumpmetadata::n, and wildcardTimespan.

Referenced by edm::service::ELdestination::setTimespan().

218  {
219  if (id[0] == '*')
221  else
222  limits[id].timespan = n;
223  }

◆ setTimespan() [2/2]

void edm::service::ELlimitsTable::setTimespan ( const messagelogger::ELseverityLevel sev,
int  n 
)

Definition at line 225 of file ELlimitsTable.cc.

References edm::messagelogger::ELseverityLevel::getLevel(), dqmiodumpmetadata::n, and severityTimespans.

225  {
226  severityTimespans[sev.getLevel()] = n;
227  }
int severityTimespans[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:90

◆ wipe()

void edm::service::ELlimitsTable::wipe ( )

Definition at line 165 of file ELlimitsTable.cc.

References counts, mps_fire::i, limits, edm::messagelogger::ELseverityLevel::nLevels, severityIntervals, severityLimits, severityTimespans, wildcardLimit, and wildcardTimespan.

Referenced by edm::service::ELstatistics::wipe(), and edm::service::ELdestination::wipe().

165  {
166  // This clears everything -- counts and aggregate counts for severity levels
167  // and for individual ID's, as well as any limits established, the limit
168  // for "*" all messages, and the collection of severity defaults. wipe()
169  // does not not affect thresholds.
170 
171  limits.erase(limits.begin(), limits.end());
172  ELmap_counts::iterator i;
173  for (i = counts.begin(); i != counts.end(); ++i) {
174  (*i).second.limit = -1;
175  (*i).second.n = (*i).second.aggregateN = 0;
176  }
177 
178  wildcardLimit = -1;
179  wildcardTimespan = -1;
180  for (int lev = 0; lev < messagelogger::ELseverityLevel::nLevels; ++lev) {
181  severityLimits[lev] = -1;
182  severityIntervals[lev] = -1;
183  severityTimespans[lev] = -1;
184  }
185  }
int severityIntervals[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:91
int severityTimespans[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:90
int severityLimits[messagelogger::ELseverityLevel::nLevels]
Definition: ELlimitsTable.h:89

◆ zero()

void edm::service::ELlimitsTable::zero ( )

Definition at line 187 of file ELlimitsTable.cc.

References counts, and mps_fire::i.

Referenced by edm::service::ELstatistics::clearSummary(), edm::service::ELstatistics::zero(), and edm::service::ELdestination::zero().

187  {
188  // This clears counts but not aggregate counts for severity levels
189  // and for individual ID's.
190 
191  ELmap_counts::iterator i;
192  for (i = counts.begin(); i != counts.end(); ++i)
193  (*i).second.n = 0;
194  }

Friends And Related Function Documentation

◆ ELdestination

friend class ELdestination
friend

Definition at line 58 of file ELlimitsTable.h.

◆ ELoutput

friend class ELoutput
friend

Definition at line 59 of file ELlimitsTable.h.

Member Data Documentation

◆ counts

ELmap_counts edm::service::ELlimitsTable::counts
protected

Definition at line 98 of file ELlimitsTable.h.

Referenced by add(), wipe(), and zero().

◆ limits

ELmap_limits edm::service::ELlimitsTable::limits
protected

Definition at line 97 of file ELlimitsTable.h.

Referenced by add(), operator=(), setInterval(), setLimit(), setTimespan(), and wipe().

◆ severityIntervals

int edm::service::ELlimitsTable::severityIntervals[messagelogger::ELseverityLevel::nLevels]
protected

Definition at line 91 of file ELlimitsTable.h.

Referenced by add(), ELlimitsTable(), setInterval(), and wipe().

◆ severityLimits

int edm::service::ELlimitsTable::severityLimits[messagelogger::ELseverityLevel::nLevels]
protected

Definition at line 89 of file ELlimitsTable.h.

Referenced by add(), ELlimitsTable(), setLimit(), and wipe().

◆ severityTimespans

int edm::service::ELlimitsTable::severityTimespans[messagelogger::ELseverityLevel::nLevels]
protected

Definition at line 90 of file ELlimitsTable.h.

Referenced by add(), ELlimitsTable(), operator=(), setTimespan(), and wipe().

◆ tableLimit

int edm::service::ELlimitsTable::tableLimit
protected

Definition at line 96 of file ELlimitsTable.h.

Referenced by add(), and setTableLimit().

◆ wildcardInterval

int edm::service::ELlimitsTable::wildcardInterval
protected

Definition at line 93 of file ELlimitsTable.h.

Referenced by add(), and setInterval().

◆ wildcardLimit

int edm::service::ELlimitsTable::wildcardLimit
protected

Definition at line 92 of file ELlimitsTable.h.

Referenced by add(), operator=(), setLimit(), and wipe().

◆ wildcardTimespan

int edm::service::ELlimitsTable::wildcardTimespan
protected

Definition at line 94 of file ELlimitsTable.h.

Referenced by add(), operator=(), setTimespan(), and wipe().