Gaudi Framework, version v23r0 |
Home | Generated: Mon Jan 30 2012 |
Monitors the memory use of each algorithm. More...
#include <MemoryAuditor.h>
Public Member Functions | |
MemoryAuditor (const std::string &name, ISvcLocator *pSvcLocator) | |
Protected Member Functions | |
virtual void | i_before (CustomEventTypeRef evt, const std::string &caller) |
Default (catch-all) "before" Auditor hook. | |
virtual void | i_after (CustomEventTypeRef evt, const std::string &caller, const StatusCode &sc) |
Default (catch-all) "after" Auditor hook. | |
virtual void | i_printinfo (const std::string &msg, CustomEventTypeRef evt, const std::string &caller) |
Report the memory usage. | |
Static Protected Member Functions | |
static bool | getProcInfo (procInfo &info) |
Get the process informations. |
Monitors the memory use of each algorithm.
Definition at line 11 of file MemoryAuditor.h.
MemoryAuditor::MemoryAuditor | ( | const std::string & | name, |
ISvcLocator * | pSvcLocator | ||
) |
Definition at line 16 of file MemoryAuditor.cpp.
: CommonAuditor(name, pSvcLocator) { }
static bool MemoryAuditor::getProcInfo | ( | procInfo & | info ) | [inline, static, protected] |
Get the process informations.
Returns true if it was possible to retrieve the informations.
Definition at line 27 of file MemoryAuditor.h.
{ return ProcStats::instance()->fetch(info); }
void MemoryAuditor::i_after | ( | CustomEventTypeRef | evt, |
const std::string & | caller, | ||
const StatusCode & | sc | ||
) | [protected, virtual] |
Default (catch-all) "after" Auditor hook.
Implements CommonAuditor.
Definition at line 24 of file MemoryAuditor.cpp.
{ i_printinfo("Memory usage has changed after", evt, caller); }
void MemoryAuditor::i_before | ( | CustomEventTypeRef | evt, |
const std::string & | caller | ||
) | [protected, virtual] |
Default (catch-all) "before" Auditor hook.
Implements CommonAuditor.
Reimplemented in MemStatAuditor.
Definition at line 20 of file MemoryAuditor.cpp.
{ i_printinfo("Memory usage before", evt, caller); }
void MemoryAuditor::i_printinfo | ( | const std::string & | msg, |
CustomEventTypeRef | evt, | ||
const std::string & | caller | ||
) | [protected, virtual] |
Report the memory usage.
Reimplemented in MemStatAuditor.
Definition at line 28 of file MemoryAuditor.cpp.
{ procInfo info; // The fetch method returns true if memory usage has changed... if(getProcInfo(info)) { MsgStream log(msgSvc(), name()); log << MSG::INFO << msg << " " << caller << " " << evt << " virtual size = " << info.vsize << " MB" << " resident set size = " << info.rss << " MB" << endmsg; } }