#include <AthenaSummarySvc.h>
Definition at line 36 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 373 of file AthenaSummarySvc.cxx.
377 list<string>::const_iterator itr;
381 ofs <<
" " << *itr << endl;
384 ofs <<
"Files written: " <<
m_outputFiles.size() << std::endl;
386 ofs <<
" " << *itr << endl;
391 ofs <<
" " << *itr << endl;
398 ofs <<
"Runs: " <<
m_runs << endl;
401 ofs <<
"Message Count: " << endl;
403 ofs <<
" ERROR: " <<
msgSvc()->messageCount( MSG::ERROR ) << endl;
404 ofs <<
" WARNING: " <<
msgSvc()->messageCount( MSG::WARNING ) << endl;
410 IProperty *
ip =
dynamic_cast<IProperty*
>(
p_logMsg );
412 if (
ip->getProperty(&
thresh).isFailure()) {
413 ATH_MSG_ERROR(
"could not get loggingLevel property of LoggedMessageSvc");
416 ATH_MSG_ERROR(
"could not dcast LoggedMessageSvc to IProperty");
421 ofs <<
"Message Log: " << endl;
422 vector<pair<string,string> > msgs;
423 vector<pair<string,string> >::const_iterator mitr;
425 ofs <<
" " << levelNames[
l];
427 ofs <<
" " << msgs.size() << endl;
428 for (mitr=msgs.begin(); mitr != msgs.end(); ++mitr) {
429 ofs <<
" " << mitr->first <<
" : " << mitr->second << endl;
433 ofs <<
"Keyword tracked messages: " << endl;
435 ofs <<
" " << levelNames[
msg.level]
437 <<
" " <<
msg.message
444 ofs <<
"Extra Summary Info:" << endl;
445 vector<pair<string,string> >::const_iterator itr (
m_extraInfo.begin() );
447 ofs <<
" " << itr->first <<
" : " << itr->second << endl;
452 ofs <<
"Extra Incident Counts:" << endl;
453 map<string, map<string,int> >::const_iterator itr(
m_extraIncidents.begin());
455 ofs <<
" " << itr->first;
456 if (itr->second.begin() == itr->second.end()) {
457 ofs <<
" : 0" << endl;
459 for (map<string,int>::const_iterator
it=itr->second.begin();
460 it != itr->second.end(); ++
it) {
461 ofs <<
" :: " <<
it->first <<
":" <<
it->second;
469 ofs <<
"std::bad_alloc caught: out of memory condition detected"
473 ofs <<
"Exit Status: " <<
m_status << endl;
◆ createDict()
void AthenaSummarySvc::createDict |
( |
std::ofstream & |
ofd | ) |
|
|
private |
Definition at line 480 of file AthenaSummarySvc.cxx.
484 list<string>::const_iterator itr;
491 if (
f.length() > 0) {
f +=
","; }
498 if (
f.length() > 0) {
f +=
","; }
505 if (
f.length() > 0) {
f +=
","; }
508 files.add(
"write error",
f);
523 msg.add(
"ERROR",
msgSvc()->messageCount( MSG::ERROR ));
524 msg.add(
"WARNING",
msgSvc()->messageCount( MSG::WARNING ));
527 p.add(
"message count",
msg);
532 IProperty *
ip =
dynamic_cast<IProperty*
>(
p_logMsg );
534 if (
ip->getProperty(&
thresh).isFailure()) {
535 ATH_MSG_ERROR(
"could not get loggingLevel property of LoggedMessageSvc");
538 ATH_MSG_ERROR(
"could not dcast LoggedMessageSvc to IProperty");
542 vector<pair<string,string> > msgs;
543 vector<pair<string,string> >::const_iterator mitr;
547 for (mitr=msgs.begin(); mitr != msgs.end(); ++mitr) {
548 slog.
add(mitr->first, mitr->second);
550 mlog.add(levelNames[
l],slog);
553 p.add(
"messages",
mlog);
559 vector<pair<string,string> >::const_iterator itr (
m_extraInfo.begin() );
561 string dat = itr->second;
562 while( dat.find(
"\n") != string::npos) {
563 dat.erase(dat.find(
"\n"),1);
565 user.add(itr->first, dat);
567 p.add(
"user data",
user);
572 map<string, map<string,int> >::const_iterator itr(
m_extraIncidents.begin());
574 if (itr->second.begin() == itr->second.end()) {
575 inc.
add(itr->first,0);
578 for (map<string,int>::const_iterator
it=itr->second.begin();
579 it != itr->second.end(); ++
it) {
580 inc2.
add(
it->first,
it->second);
582 inc.
add(itr->first, inc2);
592 p.add(
"extra incidents",inc);
596 p.add(
"bad_alloc",s_badalloc);
598 ofd <<
p.dump() << endl;
◆ createSummary()
StatusCode AthenaSummarySvc::createSummary |
( |
| ) |
|
|
overridevirtual |
Definition at line 342 of file AthenaSummarySvc.cxx.
350 return StatusCode::FAILURE;
365 return StatusCode::SUCCESS;
◆ finalize()
StatusCode AthenaSummarySvc::finalize |
( |
| ) |
|
|
overridevirtual |
Definition at line 210 of file AthenaSummarySvc.cxx.
215 delete[] s_block; s_block =
nullptr;
216 std::set_new_handler(
m_new );
218 return StatusCode::SUCCESS;
◆ getOutputFile()
virtual const std::string& AthenaSummarySvc::getOutputFile |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ handle()
void AthenaSummarySvc::handle |
( |
const Incident & |
inc | ) |
|
|
overrideprivatevirtual |
Definition at line 292 of file AthenaSummarySvc.cxx.
294 ATH_MSG_DEBUG(
"handle incident: " << inc.type() <<
" " << inc.source());
298 const FileIncident *fi =
dynamic_cast<const FileIncident*
>( &inc );
301 ATH_MSG_INFO(
" -> file incident: " << fi->fileName() <<
" [GUID: " << fi->fileGuid() <<
"]");
307 if (inc.type() ==
"BeginInputFile" ) {
309 }
else if (inc.type() ==
"BeginOutputFile") {
311 }
else if (inc.type() ==
"FailOutputFile") {
313 }
else if (inc.type() ==
"BeginEvent") {
315 }
else if (inc.type() ==
"SkipEvent") {
317 }
else if (inc.type() ==
"WriteEvent") {
319 }
else if (inc.type() ==
"BeginRun") {
321 }
else if (inc.type() ==
"EndRun") {
324 map<std::string, map<string,int> >
::iterator itr
329 if (
it != itr->second.end()) {
◆ initialize()
StatusCode AthenaSummarySvc::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 128 of file AthenaSummarySvc.cxx.
133 p_incSvc->addListener(
this,
"BeginInputFile", pri,
true);
134 p_incSvc->addListener(
this,
"EndInputFile", pri,
true);
135 p_incSvc->addListener(
this,
"BeginOutputFile", pri,
true);
136 p_incSvc->addListener(
this,
"FailOutputFile", pri,
true);
137 p_incSvc->addListener(
this,
"WroteToOutputFile", pri,
true);
138 p_incSvc->addListener(
this,
"EndOutputFile", pri,
true);
140 p_incSvc->addListener(
this,
"AbortEvent", pri,
true);
142 p_incSvc->addListener(
this,
"BeginEvent", pri,
true);
143 p_incSvc->addListener(
this,
"EndEvent", pri,
true);
144 p_incSvc->addListener(
this,
"BeginRun", pri,
true);
145 p_incSvc->addListener(
this,
"EndRun", pri,
true);
147 p_incSvc->addListener(
this,
"FirstInputFile", pri,
true );
149 vector<string>::const_iterator itr;
157 ATH_MSG_INFO(
"unable dcast IMessageSvc to ILoggedMessageSvc: "
158 "not scanning for keywords in logs, or printing logged messages");
162 IProperty *
ip =
dynamic_cast<IProperty*
>(
p_logMsg );
165 ATH_MSG_ERROR(
"could not set keywords property of LoggedMessageSvc");
168 <<
"\". CAVEAT EMPTOR - THIS IS VERY SLOW!!");
171 ATH_MSG_ERROR(
"could not dcast LoggedMessageSvc to IProperty");
182 const long pageSize = sysconf( _SC_PAGESIZE );
183 if (pageSize < 1 || pageSize > 1024*1024*1024) {
185 return StatusCode::FAILURE;
187 s_block =
new char[ pageSize * 100 ];
◆ newHandler()
void AthenaSummarySvc::newHandler |
( |
| ) |
|
|
staticprivate |
Definition at line 252 of file AthenaSummarySvc.cxx.
257 throw std::bad_alloc();
260 delete[] s_block; s_block =
nullptr;
263 std::cerr <<
"AthenaSummarySvc FATAL out of memory: saving summary ..."
266 SmartIF<IAthenaSummarySvc> ipa(Gaudi::svcLocator()->service(
"AthenaSummarySvc"));
270 if ( System::backTrace(btrace,5,3) ) {
271 ipa->addSummary(
"badalloc backtrace",btrace);
275 ipa->createSummary().ignore();
277 std::cerr <<
"AthenaSummarySvc ERROR unable to get hold of myself and print summary"
285 throw std::bad_alloc();
◆ reinitialize()
StatusCode AthenaSummarySvc::reinitialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 196 of file AthenaSummarySvc.cxx.
198 delete[] s_block; s_block =
nullptr;
199 long pageSize = sysconf( _SC_PAGESIZE );
200 if (pageSize < 1 || pageSize > 1024*1024*1024) {
202 return StatusCode::FAILURE;
204 s_block =
new char[ pageSize * 100 ];
205 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 74 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 76 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 70 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 72 of file AthenaSummarySvc.h.
◆ p_incSvc
◆ p_logMsg
The documentation for this class was generated from the following files: