#include <AthenaSummarySvc.h>
Definition at line 35 of file AthenaSummarySvc.h.
◆ AthenaSummarySvc()
AthenaSummarySvc::AthenaSummarySvc |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
svc |
|
) |
| |
◆ addListener()
void AthenaSummarySvc::addListener |
( |
const std::string & |
incident_name | ) |
|
|
overridevirtual |
◆ addSummary()
void AthenaSummarySvc::addSummary |
( |
const std::string & |
dict_key, |
|
|
const std::string & |
data |
|
) |
| |
|
overridevirtual |
◆ createASCII()
void AthenaSummarySvc::createASCII |
( |
std::ofstream & |
ofs | ) |
|
|
private |
Definition at line 366 of file AthenaSummarySvc.cxx.
370 list<string>::const_iterator itr;
374 ofs <<
" " << *itr << endl;
377 ofs <<
"Files written: " <<
m_outputFiles.size() << std::endl;
379 ofs <<
" " << *itr << endl;
384 ofs <<
" " << *itr << endl;
391 ofs <<
"Runs: " <<
m_runs << endl;
394 ofs <<
"Message Count: " << endl;
396 ofs <<
" ERROR: " <<
msgSvc()->messageCount( MSG::ERROR ) << endl;
397 ofs <<
" WARNING: " <<
msgSvc()->messageCount( MSG::WARNING ) << endl;
398 ofs <<
" INFO: " <<
msgSvc()->messageCount( MSG::INFO ) << endl;
403 IProperty *
ip =
dynamic_cast<IProperty*
>(
p_logMsg );
405 if (
ip->getProperty(&
thresh).isFailure()) {
406 ATH_MSG_ERROR(
"could not get loggingLevel property of LoggedMessageSvc");
409 ATH_MSG_ERROR(
"could not dcast LoggedMessageSvc to IProperty");
414 ofs <<
"Message Log: " << endl;
415 vector<pair<string,string> > msgs;
416 vector<pair<string,string> >::const_iterator mitr;
418 ofs <<
" " << levelNames[
l];
420 ofs <<
" " << msgs.size() << endl;
421 for (mitr=msgs.begin(); mitr != msgs.end(); ++mitr) {
422 ofs <<
" " << mitr->first <<
" : " << mitr->second << endl;
426 ofs <<
"Keyword tracked messages: " << endl;
429 ofs <<
" " << levelNames[ilm->level] <<
" " << ilm->source <<
" " << ilm->message
436 ofs <<
"Extra Summary Info:" << endl;
437 vector<pair<string,string> >::const_iterator itr (
m_extraInfo.begin() );
439 ofs <<
" " << itr->first <<
" : " << itr->second << endl;
444 ofs <<
"Extra Incident Counts:" << endl;
445 map<string, map<string,int> >::const_iterator itr(
m_extraIncidents.begin());
447 ofs <<
" " << itr->first;
448 if (itr->second.begin() == itr->second.end()) {
449 ofs <<
" : 0" << endl;
451 for (map<string,int>::const_iterator
it=itr->second.begin();
452 it != itr->second.end(); ++
it) {
453 ofs <<
" :: " <<
it->first <<
":" <<
it->second;
461 ofs <<
"std::bad_alloc caught: out of memory condition detected"
465 ofs <<
"Exit Status: " <<
m_status << endl;
◆ createDict()
void AthenaSummarySvc::createDict |
( |
std::ofstream & |
ofd | ) |
|
|
private |
Definition at line 472 of file AthenaSummarySvc.cxx.
476 list<string>::const_iterator itr;
483 if (
f.length() > 0) {
f +=
","; }
490 if (
f.length() > 0) {
f +=
","; }
497 if (
f.length() > 0) {
f +=
","; }
500 files.add(
"write error",
f);
515 msg.add(
"ERROR",
msgSvc()->messageCount( MSG::ERROR ));
516 msg.add(
"WARNING",
msgSvc()->messageCount( MSG::WARNING ));
517 msg.add(
"INFO",
msgSvc()->messageCount( MSG::INFO ));
519 p.add(
"message count",
msg);
524 IProperty *
ip =
dynamic_cast<IProperty*
>(
p_logMsg );
526 if (
ip->getProperty(&
thresh).isFailure()) {
527 ATH_MSG_ERROR(
"could not get loggingLevel property of LoggedMessageSvc");
530 ATH_MSG_ERROR(
"could not dcast LoggedMessageSvc to IProperty");
534 vector<pair<string,string> > msgs;
535 vector<pair<string,string> >::const_iterator mitr;
539 for (mitr=msgs.begin(); mitr != msgs.end(); ++mitr) {
540 slog.
add(mitr->first, mitr->second);
542 mlog.add(levelNames[
l],slog);
545 p.add(
"messages",
mlog);
551 vector<pair<string,string> >::const_iterator itr (
m_extraInfo.begin() );
553 string dat = itr->second;
554 while( dat.find(
"\n") != string::npos) {
555 dat.erase(dat.find(
"\n"),1);
557 user.add(itr->first, dat);
559 p.add(
"user data",
user);
564 map<string, map<string,int> >::const_iterator itr(
m_extraIncidents.begin());
566 if (itr->second.begin() == itr->second.end()) {
567 inc.
add(itr->first,0);
570 for (map<string,int>::const_iterator
it=itr->second.begin();
571 it != itr->second.end(); ++
it) {
572 inc2.
add(
it->first,
it->second);
574 inc.
add(itr->first, inc2);
584 p.add(
"extra incidents",inc);
588 p.add(
"bad_alloc",s_badalloc);
590 ofd <<
p.dump() << endl;
◆ createSummary()
StatusCode AthenaSummarySvc::createSummary |
( |
| ) |
|
|
overridevirtual |
Definition at line 335 of file AthenaSummarySvc.cxx.
343 return StatusCode::FAILURE;
358 return StatusCode::SUCCESS;
◆ finalize()
StatusCode AthenaSummarySvc::finalize |
( |
| ) |
|
|
overridevirtual |
Definition at line 203 of file AthenaSummarySvc.cxx.
208 delete[] s_block; s_block =
nullptr;
209 std::set_new_handler(
m_new );
211 return StatusCode::SUCCESS;
◆ getOutputFile()
virtual const std::string& AthenaSummarySvc::getOutputFile |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ handle()
void AthenaSummarySvc::handle |
( |
const Incident & |
inc | ) |
|
|
overrideprivatevirtual |
Definition at line 285 of file AthenaSummarySvc.cxx.
287 ATH_MSG_DEBUG(
"handle incident: " << inc.type() <<
" " << inc.source());
291 const FileIncident *
fi =
dynamic_cast<const FileIncident*
>( &inc );
294 ATH_MSG_INFO(
" -> file incident: " <<
fi->fileName() <<
" [GUID: " <<
fi->fileGuid() <<
"]");
300 if (inc.type() ==
"BeginInputFile" ) {
302 }
else if (inc.type() ==
"BeginOutputFile") {
304 }
else if (inc.type() ==
"FailOutputFile") {
306 }
else if (inc.type() ==
"BeginEvent") {
308 }
else if (inc.type() ==
"SkipEvent") {
310 }
else if (inc.type() ==
"WriteEvent") {
312 }
else if (inc.type() ==
"BeginRun") {
314 }
else if (inc.type() ==
"EndRun") {
317 map<std::string, map<string,int> >
::iterator itr
322 if (
it != itr->second.end()) {
◆ initialize()
StatusCode AthenaSummarySvc::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 131 of file AthenaSummarySvc.cxx.
136 p_incSvc->addListener(
this,
"BeginInputFile", pri,
true);
137 p_incSvc->addListener(
this,
"EndInputFile", pri,
true);
138 p_incSvc->addListener(
this,
"BeginOutputFile", pri,
true);
139 p_incSvc->addListener(
this,
"FailOutputFile", pri,
true);
140 p_incSvc->addListener(
this,
"WroteToOutputFile", pri,
true);
141 p_incSvc->addListener(
this,
"EndOutputFile", pri,
true);
143 p_incSvc->addListener(
this,
"AbortEvent", pri,
true);
145 p_incSvc->addListener(
this,
"BeginEvent", pri,
true);
146 p_incSvc->addListener(
this,
"EndEvent", pri,
true);
147 p_incSvc->addListener(
this,
"BeginRun", pri,
true);
148 p_incSvc->addListener(
this,
"EndRun", pri,
true);
150 p_incSvc->addListener(
this,
"FirstInputFile", pri,
true );
152 vector<string>::const_iterator itr;
160 ATH_MSG_INFO(
"unable dcast IMessageSvc to ILoggedMessageSvc: "
161 "not scanning for keywords in logs, or printing logged messages");
165 IProperty *
ip =
dynamic_cast<IProperty*
>(
p_logMsg );
168 ATH_MSG_ERROR(
"could not set keywords property of LoggedMessageSvc");
171 <<
"\". CAVEAT EMPTOR - THIS IS VERY SLOW!!");
174 ATH_MSG_ERROR(
"could not dcast LoggedMessageSvc to IProperty");
185 s_block =
new char[ sysconf( _SC_PAGESIZE ) * 100 ];
◆ newHandler()
void AthenaSummarySvc::newHandler |
( |
| ) |
|
|
staticprivate |
Definition at line 245 of file AthenaSummarySvc.cxx.
250 throw std::bad_alloc();
253 delete[] s_block; s_block =
nullptr;
256 std::cerr <<
"AthenaSummarySvc FATAL out of memory: saving summary ..."
259 SmartIF<IAthenaSummarySvc> ipa(Gaudi::svcLocator()->service(
"AthenaSummarySvc"));
263 if ( System::backTrace(btrace,5,3) ) {
264 ipa->addSummary(
"badalloc backtrace",btrace);
268 ipa->createSummary().ignore();
270 std::cerr <<
"AthenaSummarySvc ERROR unable to get hold of myself and print summary"
278 throw std::bad_alloc();
◆ reinitialize()
StatusCode AthenaSummarySvc::reinitialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 194 of file AthenaSummarySvc.cxx.
196 delete[] s_block; s_block =
nullptr;
197 s_block =
new char[ sysconf( _SC_PAGESIZE ) * 100 ];
198 return s_block ? StatusCode::SUCCESS : StatusCode::FAILURE;
◆ setStatus()
virtual void AthenaSummarySvc::setStatus |
( |
int |
s | ) |
|
|
inlineoverridevirtual |
◆ ATLAS_THREAD_SAFE [1/2]
char* s_block AthenaSummarySvc::ATLAS_THREAD_SAFE |
|
staticprivate |
◆ ATLAS_THREAD_SAFE [2/2]
bool s_badalloc AthenaSummarySvc::ATLAS_THREAD_SAFE |
|
staticprivate |
◆ m_eventsRead
unsigned int AthenaSummarySvc::m_eventsRead {0} |
|
private |
◆ m_eventsSkipped
unsigned int AthenaSummarySvc::m_eventsSkipped {0} |
|
private |
◆ m_eventsWritten
unsigned int AthenaSummarySvc::m_eventsWritten {0} |
|
private |
◆ m_extraInc
StringArrayProperty AthenaSummarySvc::m_extraInc |
|
private |
Initial value:{this, "ExtraIncidents", {},
"user incidets to monitor"}
Definition at line 73 of file AthenaSummarySvc.h.
◆ m_extraIncidents
std::map< std::string, std::map<std::string, int> > AthenaSummarySvc::m_extraIncidents |
|
private |
◆ m_extraInfo
std::vector< std::pair<std::string, std::string> > AthenaSummarySvc::m_extraInfo |
|
private |
◆ m_inputFilesRead
std::list<std::string> AthenaSummarySvc::m_inputFilesRead |
|
private |
◆ m_keywords
StringArrayProperty AthenaSummarySvc::m_keywords |
|
private |
Initial value:{this, "keywords", {},
"kewords to scan for in MessageSvc. WARNING: THIS IS VERY SLOW!!!"}
Definition at line 75 of file AthenaSummarySvc.h.
◆ m_new
std::new_handler AthenaSummarySvc::m_new {nullptr} |
|
private |
◆ m_outputFiles
std::list<std::string> AthenaSummarySvc::m_outputFiles |
|
private |
◆ m_outputFilesError
std::list<std::string> AthenaSummarySvc::m_outputFilesError |
|
private |
◆ m_runs
unsigned int AthenaSummarySvc::m_runs {0} |
|
private |
◆ m_status
int AthenaSummarySvc::m_status {0} |
|
private |
◆ m_summaryFile
StringProperty AthenaSummarySvc::m_summaryFile |
|
private |
Initial value:{this, "SummaryFile", "AthSummary.txt",
"Output File"}
Definition at line 69 of file AthenaSummarySvc.h.
◆ m_summaryFormat
StringProperty AthenaSummarySvc::m_summaryFormat |
|
private |
Initial value:{this, "SummaryFileFormat", "both",
"output format: one of 'ascii', 'python', 'both'"}
Definition at line 71 of file AthenaSummarySvc.h.
◆ p_incSvc
◆ p_logMsg
The documentation for this class was generated from the following files: