| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

MemoryAuditor Class Reference

#include <MemoryAuditor.h>

Inheritance diagram for MemoryAuditor:

[legend]
Collaboration diagram for MemoryAuditor:
[legend]
List of all members.

Public Types

typedef std::string CustomEventType
typedef const CustomEventTypeCustomEventTypeRef
 Initialize
 ReInitialize
 Execute
 BeginRun
 EndRun
 Finalize
 Start
 Stop
 ReStart
 SUCCESS
 NO_INTERFACE
 VERSMISMATCH
 LAST_ERROR
enum  StandardEventType
enum  Status

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 ()
StatusCode sysInitialize ()
virtual void before (StandardEventType, INamedInterface *)
virtual void before (StandardEventType, const std::string &)
virtual void before (CustomEventTypeRef, INamedInterface *)
virtual void before (CustomEventTypeRef, const std::string &)
virtual void before (StandardEventType, INamedInterface *)=0
virtual void before (StandardEventType, const std::string &)=0
virtual void after (StandardEventType, INamedInterface *, const StatusCode &)
virtual void after (StandardEventType, const std::string &, const StatusCode &)
virtual void after (CustomEventTypeRef, INamedInterface *, const StatusCode &)
virtual void after (CustomEventTypeRef, const std::string &, const StatusCode &)
virtual void after (StandardEventType, INamedInterface *, const StatusCode &sc=StatusCode(StatusCode::SUCCESS, true))=0
virtual void after (StandardEventType, const std::string &, const StatusCode &sc=StatusCode(StatusCode::SUCCESS, true))=0
virtual StatusCode initialize ()
virtual StatusCode finalize ()
virtual const std::string & name () const
virtual bool isEnabled () const
IMessageSvcmsgSvc () const
int outputLevel () const
void setOutputLevel (int level)
ISvcLocatorserviceLocator () const
StatusCode service (const std::string &name, T *&svc, bool createIf=false) const
virtual StatusCode setProperty (const Property &p)
virtual StatusCode setProperty (const std::string &s)
virtual StatusCode setProperty (const std::string &n, const std::string &v)
StatusCode setProperty (const std::string &name, const TYPE &value)
virtual StatusCode getProperty (Property *p) const
virtual const PropertygetProperty (const std::string &name) const
virtual StatusCode getProperty (const std::string &n, std::string &v) const
const std::vector< Property * > & getProperties () const
StatusCode setProperties ()
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
unsigned long addRef ()
unsigned long release ()
StatusCode queryInterface (const InterfaceID &riid, void **)

Static Public Member Functions

static const InterfaceIDinterfaceID ()
static const InterfaceIDinterfaceID ()

Public Attributes

 Initialize
 ReInitialize
 Execute
 BeginRun
 EndRun
 Finalize
 Start
 Stop
 ReStart
 SUCCESS
 NO_INTERFACE
 VERSMISMATCH
 LAST_ERROR

Private Member Functions

bool printinfo (std::string theString)

Private Attributes

StringArrayProperty m_types

Detailed Description

Definition at line 14 of file MemoryAuditor.h.


Constructor & Destructor Documentation

MemoryAuditor::MemoryAuditor ( const std::string &  name,
ISvcLocator pSvcLocator 
)

Definition at line 13 of file MemoryAuditor.cpp.

00013                                                                             :
00014   Auditor(name, pSvcLocator) 
00015 {
00016   declareProperty("CustomEventTypes",m_types);
00017 
00018 }

MemoryAuditor::~MemoryAuditor (  )  [virtual]

Definition at line 20 of file MemoryAuditor.cpp.

00020                              {
00021 }


Member Function Documentation

void MemoryAuditor::beforeInitialize ( INamedInterface alg  )  [virtual]

Reimplemented from Auditor.

Definition at line 23 of file MemoryAuditor.cpp.

00023                                                          {
00024   std::string theString = "Memory usage before ";
00025   theString += alg->name() ;
00026   theString += " Initialization Method";
00027   printinfo(theString);
00028 }

void MemoryAuditor::afterInitialize ( INamedInterface alg  )  [virtual]

Reimplemented from Auditor.

Definition at line 29 of file MemoryAuditor.cpp.

00029                                                         {
00030   std::string theString = "Memory usage has changed after ";
00031   theString += alg->name() ;
00032   theString += " Initialization Method";
00033   printinfo(theString);
00034 }

void MemoryAuditor::beforeReinitialize ( INamedInterface alg  )  [virtual]

Reimplemented from Auditor.

Definition at line 35 of file MemoryAuditor.cpp.

00035                                                            {
00036   std::string theString = "Memory usage before ";
00037   theString += alg->name() ;
00038   theString += " Reinitialization Method";
00039   printinfo(theString);
00040 }

void MemoryAuditor::afterReinitialize ( INamedInterface alg  )  [virtual]

Reimplemented from Auditor.

Definition at line 41 of file MemoryAuditor.cpp.

00041                                                           {
00042   std::string theString = "Memory usage has changed after ";
00043   theString += alg->name() ;
00044   theString += " Reinitialization Method";
00045   printinfo(theString);
00046 }

void MemoryAuditor::beforeExecute ( INamedInterface alg  )  [virtual]

Reimplemented from Auditor.

Definition at line 47 of file MemoryAuditor.cpp.

00047                                                       {
00048   std::string theString = "Memory usage has changed before ";
00049   theString += alg->name() ;
00050   theString += " Execute Method";
00051   printinfo(theString);
00052 }

void MemoryAuditor::afterExecute ( INamedInterface alg,
const StatusCode  
) [virtual]

Reimplemented from Auditor.

Definition at line 53 of file MemoryAuditor.cpp.

00053                                                                           {
00054   std::string theString = "Memory usage has changed after ";
00055   theString += alg->name() ;
00056   theString += " Execute Method";
00057   printinfo(theString);
00058 }

void MemoryAuditor::beforeBeginRun ( INamedInterface alg  )  [virtual]

Reimplemented from Auditor.

Definition at line 59 of file MemoryAuditor.cpp.

00059                                                        {
00060   std::string theString = "Memory usage before ";
00061   theString += ini->name() ;
00062   theString += " BeginRun Method";
00063   printinfo(theString);
00064 }

void MemoryAuditor::afterBeginRun ( INamedInterface alg  )  [virtual]

Reimplemented from Auditor.

Definition at line 65 of file MemoryAuditor.cpp.

00065                                                       {
00066   std::string theString = "Memory usage has changed after ";
00067   theString += ini->name() ;
00068   theString += " BeginRun Method";
00069   printinfo(theString);
00070 }

void MemoryAuditor::beforeEndRun ( INamedInterface alg  )  [virtual]

Reimplemented from Auditor.

Definition at line 71 of file MemoryAuditor.cpp.

00071                                                      {
00072   std::string theString = "Memory usage before ";
00073   theString += ini->name() ;
00074   theString += " EndRun Method";
00075   printinfo(theString);
00076 }

void MemoryAuditor::afterEndRun ( INamedInterface alg  )  [virtual]

Reimplemented from Auditor.

Definition at line 77 of file MemoryAuditor.cpp.

00077                                                     {
00078   std::string theString = "Memory usage has changed after ";
00079   theString += ini->name() ;
00080   theString += " EndRun Method";
00081   printinfo(theString);
00082 }

void MemoryAuditor::beforeFinalize ( INamedInterface alg  )  [virtual]

Reimplemented from Auditor.

Definition at line 83 of file MemoryAuditor.cpp.

00083                                                         {
00084   std::string theString = "Memory usage has changed before ";
00085   theString += alg->name() ;
00086   theString += " Finalize Method";
00087   printinfo(theString);
00088 }

void MemoryAuditor::afterFinalize ( INamedInterface alg  )  [virtual]

Reimplemented from Auditor.

Definition at line 89 of file MemoryAuditor.cpp.

00089                                                       {
00090   std::string theString = "Memory usage has changed after ";
00091   theString += alg->name() ;
00092   theString += " Finalize Method";
00093   printinfo(theString);
00094 }

void MemoryAuditor::before ( CustomEventTypeRef  evt,
const std::string &  caller 
) [virtual]

Definition at line 97 of file MemoryAuditor.cpp.

00097                                                                      {
00098   if (m_types.value().size() != 0) {
00099     if ( (m_types.value())[0] == "none") {
00100       return;
00101     }
00102     
00103     if ( find(m_types.value().begin(), m_types.value().end(), evt) == 
00104          m_types.value().end() ) {
00105       return;
00106     }
00107   }
00108 
00109   std::string theString = "Memory usage before ";
00110   theString += caller + " with auditor trigger " + evt;
00111   printinfo(theString);
00112 
00113 }

void MemoryAuditor::after ( CustomEventTypeRef  evt,
const std::string &  caller,
const StatusCode  
) [virtual]

Definition at line 116 of file MemoryAuditor.cpp.

00116                                                                                        {
00117 
00118   if (m_types.value().size() != 0) {
00119     if ( (m_types.value())[0] == "none") {
00120       return;
00121     }
00122     
00123     if ( find(m_types.value().begin(), m_types.value().end(), evt) == 
00124          m_types.value().end() ) {
00125       return;
00126     }
00127   }
00128 
00129   std::string theString = "Memory usage has changed after ";
00130   theString += caller + " with auditor trigger " + evt; 
00131   printinfo(theString);
00132 
00133 }

StatusCode MemoryAuditor::sysFinalize (  )  [virtual]

Reimplemented from Auditor.

Definition at line 136 of file MemoryAuditor.cpp.

00137 {
00138   return StatusCode::SUCCESS;
00139 }

bool MemoryAuditor::printinfo ( std::string  theString  )  [private]

Definition at line 141 of file MemoryAuditor.cpp.

00142 {
00143    ProcStats* p = ProcStats::instance();
00144    procInfo info;
00145 
00146    // The fetch method returns true if memory usage has changed...
00147    if( p->fetch(info) == true) {
00148      MsgStream log(msgSvc(), name());
00149      log << MSG::INFO << theString <<
00150        " virtual size = " << info.vsize << " MB"  <<
00151        " resident set size = " << info.rss << " MB" << endreq;
00152      return true;
00153     }
00154    else {
00155       return false;
00156    }
00157 }


Member Data Documentation

StringArrayProperty MemoryAuditor::m_types [private]

Definition at line 39 of file MemoryAuditor.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 19:59:13 2011 for GaudiAud by doxygen 1.4.7