59 , updatedStats (
false )
60 , termStream ( std::
cerr )
61 , printAtTermination(
true )
64 #ifdef ELstatisticsCONSTRUCTOR_TRACE
65 std::cerr <<
"Constructor for ELstatistics()\n";
75 , updatedStats (
false )
77 , printAtTermination(
true )
80 #ifdef ELstatisticsCONSTRUCTOR_TRACE
81 std::cerr <<
"Constructor for ELstatistics(osp)\n";
89 , tableLimit ( spaceLimit )
91 , updatedStats (
false )
92 , termStream ( std::
cerr )
93 , printAtTermination(
true )
96 #ifdef ELstatisticsCONSTRUCTOR_TRACE
97 std::cerr <<
"Constructor for ELstatistics(spaceLimit)\n";
105 , tableLimit ( spaceLimit )
107 , updatedStats (
false )
109 , printAtTermination(
true )
112 #ifdef ELstatisticsCONSTRUCTOR_TRACE
113 std::cerr <<
"Constructor for ELstatistics(spaceLimit,osp)\n";
121 , tableLimit ( orig.tableLimit )
122 , stats ( orig.stats )
123 , updatedStats ( orig.updatedStats )
124 , termStream ( orig.termStream )
125 , printAtTermination( orig.printAtTermination )
128 #ifdef ELstatisticsCONSTRUCTOR_TRACE
129 std::cerr <<
"Copy constructor for ELstatistics()\n";
142 #ifdef ELstatisticsCONSTRUCTOR_TRACE
143 std::cerr <<
"Destructor for ELstatistics\n";
166 #ifdef ELstatsLOG_TRACE
167 std::cerr <<
" =:=:=: Log to an ELstatistics\n";
177 ELmap_stats::iterator
s =
stats.find( msg.
xid() );
178 if ( s ==
stats.end() ) {
184 #ifdef ELstatsLOG_TRACE
185 std::cerr <<
" =:=:=: Message accounted for in stats \n";
187 if ( s !=
stats.end() ) {
188 #ifdef ELstatsLOG_TRACE
189 std::cerr <<
" =:=:=: Message not last stats \n";
190 std::cerr <<
" =:=:=: getContextSupplier \n";
193 std::cerr <<
" =:=:=: getContextSupplier \n";
195 std::cerr <<
" =:=:=: summaryContext \n";
197 std::cerr <<
" =:=:=: summaryContext is: " << sumcon <<
"\n";
198 (*s).second.add( sumcon, msg.
reactedTo() );
202 getContextSupplier().summaryContext(), msg.
reactedTo() );
206 #ifdef ELstatsLOG_TRACE
216 #ifdef ELstatsLOG_TRACE
217 std::cerr <<
" =:=:=: log(msg) done (stats) \n";
233 ELmap_stats::iterator
s;
236 (*s).second.context1 = (*s).second.context2 = (*s).second.contextLast =
"";
266 std::ostringstream
s;
272 bool ftnote(
false );
276 part3() :
n(0
L),
t(0
L) { ; }
281 for ( ELmap_stats::const_iterator
i = stats.begin();
i != stats.end(); ++
i ) {
284 std::string cat = (*i).first.id;
292 if ( n == 0 || !
eq(lastProcess, (*i).first.process) ) {
294 lastProcess = (*i).first.process;
295 if ( lastProcess.size() > 0) {
296 s <<
"Process " << (*i).first.process <<
'\n';
298 s <<
" type category sev module "
299 "subroutine count total\n"
300 <<
" ---- -------------------- -- ---------------- "
301 "---------------- ----- -----\n"
306 s << right << std::setw( 5) << ++n <<
' '
307 << left << std::setw(20) << (*i).first.id.substr(0,20) <<
' '
308 << left << std::setw( 2) << (*i).first.severity.getSymbol() <<
' '
309 << left << std::setw(16) << (*i).first.module.substr(0,16) <<
' '
310 << left << std::setw(16) << (*i).first.subroutine.substr(0,16)
311 << right << std::setw( 7) << (*i).second.n
312 << left << std::setw( 1) << ( (*i).second.ignoredFlag ?
'*' :
' ' )
313 << right << std::setw( 8) << (*i).second.aggregateN <<
'\n'
315 ftnote = ftnote || (*i).second.ignoredFlag;
327 int groupAggregateN = 0;
329 bool groupIgnored =
true;
330 for ( ELmap_stats::const_iterator
i = stats.begin();
i != stats.end(); ++
i ) {
331 if ( (*i).first.id == *
g ) {
332 if (groupTotal==0) severityLevel = (*i).first.severity;
333 groupIgnored &= (*i).second.ignoredFlag;
334 groupAggregateN += (*i).second.aggregateN;
338 if (groupTotal > 0) {
341 s << right << std::setw( 5) << ++n <<
' '
342 << left << std::setw(20) << (*g).substr(0,20) <<
' '
343 << left << std::setw( 2) << severityLevel.
getSymbol() <<
' '
344 << left << std::setw(16) <<
" <Any Module> " <<
' '
345 << left << std::setw(16) <<
"<Any Function>"
346 << right << std::setw( 7) << groupTotal
347 << left << std::setw( 1) << ( groupIgnored ?
'*' :
' ' )
348 << right << std::setw( 8) << groupAggregateN <<
'\n'
350 ftnote = ftnote || groupIgnored;
355 p3[lev].n += groupTotal;
356 p3[lev].t += groupAggregateN;
363 s <<
"\n* Some occurrences of this message"
364 " were suppressed in all logs, due to limits.\n"
370 for ( ELmap_stats::const_iterator
i = stats.begin();
i != stats.end(); ++
i ) {
371 std::string cat = (*i).first.id;
378 <<
" type category Examples: "
379 "run/evt run/evt run/evt\n"
380 <<
" ---- -------------------- ----"
381 "------------ ---------------- ----------------\n"
384 s << right << std::setw( 5) << ++n <<
' '
385 << left << std::setw(20) << (*i).first.id.c_str() <<
' '
386 << left << std::setw(16) << (*i).second.context1.c_str() <<
' '
387 << left << std::setw(16) << (*i).second.context2.c_str() <<
' '
388 << (*i).second.contextLast.c_str() <<
'\n'
394 s <<
"\nSeverity # Occurrences Total Occurrences\n"
395 <<
"-------- ------------- -----------------\n";
397 if (
p3[
k].n != 0 ||
p3[
k].
t != 0 ) {
399 << right << std::setw(17) <<
p3[
k].n
400 << right << std::setw(20) <<
p3[
k].t
428 termStream <<
"\n=============================================\n\n"
447 return std::map<ELextendedID , StatsCount> (
stats );
456 part3() :
n(0
L),
t(0
L) { ; }
463 for ( ELmap_stats::const_iterator
i =
stats.begin();
i !=
stats.end(); ++
i ) {
466 std::string cat = (*i).first.id;
474 std::ostringstream
s;
476 std::string sevSymbol = (*i).first.severity.getSymbol();
477 if ( sevSymbol[0] ==
'-' ) sevSymbol = sevSymbol.substr(1);
478 s << sevSymbol <<
"_" << (*i).first.id;
479 int n = (*i).second.aggregateN;
480 std::string catstr = s.str();
481 if (sm.find(catstr) != sm.end()) {
496 int groupAggregateN = 0;
498 for ( ELmap_stats::const_iterator
i =
stats.begin();
i !=
stats.end(); ++
i ) {
499 if ( (*i).first.id == *
g ) {
500 if (groupTotal==0) severityLevel = (*i).first.severity;
501 groupAggregateN += (*i).second.aggregateN;
505 if (groupTotal > 0) {
508 std::ostringstream
s;
510 std::string sevSymbol = severityLevel.
getSymbol();
511 if ( sevSymbol[0] ==
'-' ) sevSymbol = sevSymbol.substr(1);
512 s << sevSymbol <<
"_" << *
g;
513 int n = groupAggregateN;
514 std::string catstr = s.str();
515 if (sm.find(catstr) != sm.end()) {
524 p3[lev].n += groupTotal;
525 p3[lev].t += groupAggregateN;
538 if (sevName ==
"Severe") sevName =
"System";
539 if (sevName ==
"Success") sevName =
"Debug";
540 sevName = std::string(
"Log")+sevName;
542 if (sevName !=
"UnusedSeverity") {
543 sm[sevName] =
p3[
k].t;
552 if (s==
"LogDebug")
return "LogDebug_LogTrace";
553 if (s==
"LogInfo")
return "LogInfo_LogVerbatim";
554 if (s==
"LogWarning")
return "LogWarnng_LogPrint";
555 if (s==
"LogError")
return "LogError_LogProblem";
556 if (s==
"LogSystem")
return "LogSystem_LogAbsolute";
557 return "UnusedSeverity";
static std::set< std::string > groupedCategories
const ELcontextSupplier & getContextSupplier() const
virtual ELstatistics * clone() const
virtual std::map< ELextendedID, StatsCount > statisticsMap() const
std::string dualLogName(std::string const &s)
virtual bool thisShouldBeIgnored(const ELstring &s) const
ELseverityLevel threshold
std::ostream & termStream
void noTerminationSummary()
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
static ELstring formSummary(ELmap_stats &stats)
const ELstring getSymbol() const
const ELextendedID & xid() const
virtual void clearSummary()
bool eq(const ELstring &s1, const ELstring s2)
const ELstring getName() const
ELset_string respondToThese
static void noteGroupedCategory(std::string const &cat)
static ELadministrator * instance()
std::map< ELextendedID, StatsCount > ELmap_stats
bool respondToMostModules
virtual void summaryForJobReport(std::map< std::string, double > &sm)
virtual void summarization(const ELstring &title, const ELstring &sumLines)
virtual bool log(const edm::ErrorObj &msg)
virtual ELstring summaryContext() const =0