|
Gaudi Framework, version v22r1 |
| Home | Generated: Mon Feb 28 2011 |
#include <MemoryAuditor.h>


Public Member Functions | |
| MemoryAuditor (const std::string &name, ISvcLocator *pSvcLocator) | |
| virtual | ~MemoryAuditor () |
| virtual void | beforeInitialize (INamedInterface *alg) |
| virtual void | afterInitialize (INamedInterface *alg) |
| virtual void | beforeReinitialize (INamedInterface *alg) |
| virtual void | afterReinitialize (INamedInterface *alg) |
| virtual void | beforeExecute (INamedInterface *alg) |
| virtual void | afterExecute (INamedInterface *alg, const StatusCode &) |
| virtual void | beforeBeginRun (INamedInterface *alg) |
| virtual void | afterBeginRun (INamedInterface *alg) |
| virtual void | beforeEndRun (INamedInterface *alg) |
| virtual void | afterEndRun (INamedInterface *alg) |
| virtual void | beforeFinalize (INamedInterface *alg) |
| virtual void | afterFinalize (INamedInterface *alg) |
| virtual void | before (CustomEventTypeRef evt, const std::string &caller) |
| virtual void | after (CustomEventTypeRef evt, const std::string &caller, const StatusCode &) |
| virtual StatusCode | sysFinalize () |
| Finalization method invoked by the framework. | |
Private Member Functions | |
| bool | printinfo (std::string theString) |
Private Attributes | |
| StringArrayProperty | m_types |
Definition at line 12 of file MemoryAuditor.h.
| MemoryAuditor::MemoryAuditor | ( | const std::string & | name, |
| ISvcLocator * | pSvcLocator | ||
| ) |
Definition at line 17 of file MemoryAuditor.cpp.
: Auditor(name, pSvcLocator) { declareProperty("CustomEventTypes",m_types); }
| MemoryAuditor::~MemoryAuditor | ( | ) | [virtual] |
Definition at line 24 of file MemoryAuditor.cpp.
{
}
| void MemoryAuditor::after | ( | CustomEventTypeRef | evt, |
| const std::string & | caller, | ||
| const StatusCode & | |||
| ) | [virtual] |
Reimplemented from Auditor.
Definition at line 120 of file MemoryAuditor.cpp.
{
if (m_types.value().size() != 0) {
if ( (m_types.value())[0] == "none") {
return;
}
if ( find(m_types.value().begin(), m_types.value().end(), evt) ==
m_types.value().end() ) {
return;
}
}
std::string theString = "Memory usage has changed after ";
theString += caller + " with auditor trigger " + evt;
printinfo(theString);
}
| void MemoryAuditor::afterBeginRun | ( | INamedInterface * | alg ) | [virtual] |
Reimplemented from Auditor.
Definition at line 69 of file MemoryAuditor.cpp.
{
std::string theString = "Memory usage has changed after ";
theString += ini->name() ;
theString += " BeginRun Method";
printinfo(theString);
}
| void MemoryAuditor::afterEndRun | ( | INamedInterface * | alg ) | [virtual] |
Reimplemented from Auditor.
Definition at line 81 of file MemoryAuditor.cpp.
{
std::string theString = "Memory usage has changed after ";
theString += ini->name() ;
theString += " EndRun Method";
printinfo(theString);
}
| void MemoryAuditor::afterExecute | ( | INamedInterface * | alg, |
| const StatusCode & | |||
| ) | [virtual] |
Reimplemented from Auditor.
Definition at line 57 of file MemoryAuditor.cpp.
{
std::string theString = "Memory usage has changed after ";
theString += alg->name() ;
theString += " Execute Method";
printinfo(theString);
}
| void MemoryAuditor::afterFinalize | ( | INamedInterface * | alg ) | [virtual] |
Reimplemented from Auditor.
Definition at line 93 of file MemoryAuditor.cpp.
{
std::string theString = "Memory usage has changed after ";
theString += alg->name() ;
theString += " Finalize Method";
printinfo(theString);
}
| void MemoryAuditor::afterInitialize | ( | INamedInterface * | alg ) | [virtual] |
Reimplemented from Auditor.
Definition at line 33 of file MemoryAuditor.cpp.
{
std::string theString = "Memory usage has changed after ";
theString += alg->name() ;
theString += " Initialization Method";
printinfo(theString);
}
| void MemoryAuditor::afterReinitialize | ( | INamedInterface * | alg ) | [virtual] |
Reimplemented from Auditor.
Definition at line 45 of file MemoryAuditor.cpp.
{
std::string theString = "Memory usage has changed after ";
theString += alg->name() ;
theString += " Reinitialization Method";
printinfo(theString);
}
| void MemoryAuditor::before | ( | CustomEventTypeRef | evt, |
| const std::string & | caller | ||
| ) | [virtual] |
Reimplemented from Auditor.
Definition at line 101 of file MemoryAuditor.cpp.
{
if (m_types.value().size() != 0) {
if ( (m_types.value())[0] == "none") {
return;
}
if ( find(m_types.value().begin(), m_types.value().end(), evt) ==
m_types.value().end() ) {
return;
}
}
std::string theString = "Memory usage before ";
theString += caller + " with auditor trigger " + evt;
printinfo(theString);
}
| void MemoryAuditor::beforeBeginRun | ( | INamedInterface * | alg ) | [virtual] |
Reimplemented from Auditor.
Definition at line 63 of file MemoryAuditor.cpp.
{
std::string theString = "Memory usage before ";
theString += ini->name() ;
theString += " BeginRun Method";
printinfo(theString);
}
| void MemoryAuditor::beforeEndRun | ( | INamedInterface * | alg ) | [virtual] |
Reimplemented from Auditor.
Definition at line 75 of file MemoryAuditor.cpp.
{
std::string theString = "Memory usage before ";
theString += ini->name() ;
theString += " EndRun Method";
printinfo(theString);
}
| void MemoryAuditor::beforeExecute | ( | INamedInterface * | alg ) | [virtual] |
Reimplemented from Auditor.
Definition at line 51 of file MemoryAuditor.cpp.
{
std::string theString = "Memory usage has changed before ";
theString += alg->name() ;
theString += " Execute Method";
printinfo(theString);
}
| void MemoryAuditor::beforeFinalize | ( | INamedInterface * | alg ) | [virtual] |
Reimplemented from Auditor.
Definition at line 87 of file MemoryAuditor.cpp.
{
std::string theString = "Memory usage has changed before ";
theString += alg->name() ;
theString += " Finalize Method";
printinfo(theString);
}
| void MemoryAuditor::beforeInitialize | ( | INamedInterface * | alg ) | [virtual] |
Reimplemented from Auditor.
Definition at line 27 of file MemoryAuditor.cpp.
{
std::string theString = "Memory usage before ";
theString += alg->name() ;
theString += " Initialization Method";
printinfo(theString);
}
| void MemoryAuditor::beforeReinitialize | ( | INamedInterface * | alg ) | [virtual] |
Reimplemented from Auditor.
Definition at line 39 of file MemoryAuditor.cpp.
{
std::string theString = "Memory usage before ";
theString += alg->name() ;
theString += " Reinitialization Method";
printinfo(theString);
}
| bool MemoryAuditor::printinfo | ( | std::string | theString ) | [private] |
Definition at line 145 of file MemoryAuditor.cpp.
{
ProcStats* p = ProcStats::instance();
procInfo info;
// The fetch method returns true if memory usage has changed...
if( p->fetch(info) == true) {
MsgStream log(msgSvc(), name());
log << MSG::INFO << theString <<
" virtual size = " << info.vsize << " MB" <<
" resident set size = " << info.rss << " MB" << endmsg;
return true;
}
else {
return false;
}
}
| StatusCode MemoryAuditor::sysFinalize | ( | ) | [virtual] |
Finalization method invoked by the framework.
This method is responsible for any bookkeeping of initialization required by the framework itself.
RETURN !!!
catch GaudiExeption
(1) perform the printout of message
(2) print the exception itself (NB! - GaudiException is a linked list of all "previous exceptions")
catch std::exception
(1) perform the printout of message
(2) print the exception itself
catch unknown exception
(1) perform the printout
Reimplemented from Auditor.
Definition at line 140 of file MemoryAuditor.cpp.
{
return StatusCode::SUCCESS;
}
StringArrayProperty MemoryAuditor::m_types [private] |
Definition at line 37 of file MemoryAuditor.h.