43 if (
c.substr(0, 4) !=
"Run:")
45 std::istringstream is(
c);
51 if (runWord !=
"Run:")
55 is >> eventWord >>
event;
58 if (eventWord !=
"Event:")
60 std::ostringstream os;
75 ELstatistics::ELstatistics()
81 printAtTermination(
true) {
82 #ifdef ELstatisticsCONSTRUCTOR_TRACE
83 std::cerr <<
"Constructor for ELstatistics()\n";
90 #ifdef ELstatisticsCONSTRUCTOR_TRACE
91 std::cerr <<
"Constructor for ELstatistics(osp)\n";
98 tableLimit(spaceLimit),
102 printAtTermination(
true) {
103 #ifdef ELstatisticsCONSTRUCTOR_TRACE
104 std::cerr <<
"Constructor for ELstatistics(spaceLimit)\n";
111 tableLimit(spaceLimit),
115 printAtTermination(
true) {
116 #ifdef ELstatisticsCONSTRUCTOR_TRACE
117 std::cerr <<
"Constructor for ELstatistics(spaceLimit,osp)\n";
124 tableLimit(orig.tableLimit),
126 updatedStats(orig.updatedStats),
127 termStream(orig.termStream),
128 printAtTermination(orig.printAtTermination) {
129 #ifdef ELstatisticsCONSTRUCTOR_TRACE
130 std::cerr <<
"Copy constructor for ELstatistics()\n";
141 #ifdef ELstatisticsCONSTRUCTOR_TRACE
142 std::cerr <<
"Destructor for ELstatistics\n";
155 #ifdef ELstatsLOG_TRACE
156 std::cerr <<
" =:=:=: Log to an ELstatistics\n";
168 ELmap_stats::iterator
s =
stats.find(
msg.xid());
175 #ifdef ELstatsLOG_TRACE
176 std::cerr <<
" =:=:=: Message accounted for in stats \n";
179 (*s).second.add(summarizeContext(
msg.context()),
msg.reactedTo());
182 #ifdef ELstatsLOG_TRACE
191 #ifdef ELstatsLOG_TRACE
192 std::cerr <<
" =:=:=: log(msg) done (stats) \n";
201 ELmap_stats::iterator
s;
204 (*s).second.context1 = (*s).second.context2 = (*s).second.contextLast =
"";
226 std::ostringstream
s;
235 part3() :
n(0
L),
t(0
L) { ; }
240 for (ELmap_stats::const_iterator
i =
stats.begin();
i !=
stats.end(); ++
i) {
251 s <<
" type category sev module "
252 "subroutine count total\n"
253 <<
" ---- -------------------- -- ---------------- "
254 "---------------- ----- -----\n";
258 s << right << std::setw(5) << ++
n <<
' ' << left << std::setw(20) << (*i).first.id.substr(0, 20) <<
' ' << left
259 << std::setw(2) << (*i).first.severity.getSymbol() <<
' ' << left << std::setw(16)
260 << (*i).first.module.substr(0, 16) <<
' ' << left << std::setw(16) << (*i).first.subroutine.substr(0, 16)
261 << right << std::setw(7) << (*i).second.n << left << std::setw(1) << ((*i).second.ignoredFlag ?
'*' :
' ')
262 << right << std::setw(8) << (*i).second.aggregateN <<
'\n';
263 ftnote = ftnote || (*i).second.ignoredFlag;
275 int groupAggregateN = 0;
277 bool groupIgnored =
true;
278 for (ELmap_stats::const_iterator
i =
stats.begin();
i !=
stats.end(); ++
i) {
279 if ((*i).first.id == *
g) {
282 groupIgnored &= (*i).second.ignoredFlag;
283 groupAggregateN += (*i).second.aggregateN;
287 if (groupTotal > 0) {
290 s << right << std::setw(5) << ++
n <<
' ' << left << std::setw(20) << (*g).substr(0, 20) <<
' ' << left
291 << std::setw(2) <<
severityLevel.getSymbol() <<
' ' << left << std::setw(16) <<
" <Any Module> " <<
' '
292 << left << std::setw(16) <<
"<Any Function>" << right << std::setw(7) << groupTotal << left << std::setw(1)
293 << (groupIgnored ?
'*' :
' ') << right << std::setw(8) << groupAggregateN <<
'\n';
294 ftnote = ftnote || groupIgnored;
299 p3[lev].n += groupTotal;
300 p3[lev].t += groupAggregateN;
307 s <<
"\n* Some occurrences of this message"
308 " were suppressed in all logs, due to limits.\n";
313 for (ELmap_stats::const_iterator
i =
stats.begin();
i !=
stats.end(); ++
i) {
320 <<
" type category Examples: "
321 "run/evt run/evt run/evt\n"
322 <<
" ---- -------------------- ----"
323 "------------ ---------------- ----------------\n";
325 s << right << std::setw(5) << ++
n <<
' ' << left << std::setw(20) << (*i).first.id.c_str() <<
' ' << left
326 << std::setw(16) << (*i).second.context1.c_str() <<
' ' << left << std::setw(16)
327 << (*i).second.context2.c_str() <<
' ' << (*i).second.contextLast.c_str() <<
'\n';
332 s <<
"\nSeverity # Occurrences Total Occurrences\n"
333 <<
"-------- ------------- -----------------\n";
337 << std::setw(17) <<
p3[
k].n << right << std::setw(20) <<
p3[
k].t <<
'\n';
352 termStream <<
"\n=============================================\n\n"
353 <<
"MessageLogger Summary" << std::endl
355 <<
"dropped waiting message count " << overfullWaitCount << std::endl
364 return std::map<ELextendedID, StatsCount>(
stats);
371 part3() :
n(0
L),
t(0
L) { ; }
378 for (ELmap_stats::const_iterator
i =
stats.begin();
i !=
stats.end(); ++
i) {
387 std::ostringstream
s;
389 std::string sevSymbol = (*i).first.severity.getSymbol();
390 if (sevSymbol[0] ==
'-')
391 sevSymbol = sevSymbol.substr(1);
392 s << sevSymbol <<
"_" << (*i).first.id;
393 int n = (*i).second.aggregateN;
395 if (sm.find(catstr) != sm.end()) {
410 int groupAggregateN = 0;
412 for (ELmap_stats::const_iterator
i =
stats.begin();
i !=
stats.end(); ++
i) {
413 if ((*i).first.id == *
g) {
416 groupAggregateN += (*i).second.aggregateN;
420 if (groupTotal > 0) {
423 std::ostringstream
s;
426 if (sevSymbol[0] ==
'-')
427 sevSymbol = sevSymbol.substr(1);
428 s << sevSymbol <<
"_" << *
g;
429 int n = groupAggregateN;
431 if (sm.find(catstr) != sm.end()) {
440 p3[lev].n += groupTotal;
441 p3[lev].t += groupAggregateN;
454 if (sevName ==
"Severe")
456 if (sevName ==
"Success")
460 if (sevName !=
"UnusedSeverity") {
461 sm[sevName] =
p3[
k].t;
470 return "LogDebug_LogTrace";
472 return "LogInfo_LogVerbatim";
473 if (
s ==
"LogWarning")
474 return "LogWarnng_LogPrint";
476 return "LogError_LogProblem";
477 if (
s ==
"LogSystem")
478 return "LogSystem_LogAbsolute";
479 return "UnusedSeverity";