Gaudi Framework, version v23r5

Home   Generated: Wed Nov 28 2012
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MemStatAuditor Class Reference

Just a minor modification of MemoryAuditor to allow the output memory statistics table to be printed. More...

#include <GaudiAud/MemStatAudit.h>

Inheritance diagram for MemStatAuditor:
Inheritance graph
[legend]
Collaboration diagram for MemStatAuditor:
Collaboration graph
[legend]

Public Member Functions

 MemStatAuditor (const std::string &name, ISvcLocator *pSvcLocator)
 local
 
virtual ~MemStatAuditor ()
 
virtual StatusCode initialize ()
 
- Public Member Functions inherited from MemoryAuditor
 MemoryAuditor (const std::string &name, ISvcLocator *pSvcLocator)
 
- Public Member Functions inherited from CommonAuditor
 CommonAuditor (const std::string &name, ISvcLocator *svcloc)
 Constructor.
 
virtual ~CommonAuditor ()
 Destructor.
 
virtual void before (StandardEventType evt, const std::string &caller)
 
virtual void before (StandardEventType evt, INamedInterface *caller)
 The following methods are meant to be implemented by the child class...
 
virtual void before (CustomEventTypeRef evt, const std::string &caller)
 
virtual void before (CustomEventTypeRef evt, INamedInterface *caller)
 
virtual void after (StandardEventType evt, const std::string &caller, const StatusCode &sc)
 
virtual void after (StandardEventType evt, INamedInterface *caller, const StatusCode &sc)
 
virtual void after (CustomEventTypeRef evt, const std::string &caller, const StatusCode &sc)
 
virtual void after (CustomEventTypeRef evt, INamedInterface *caller, const StatusCode &sc)
 
- Public Member Functions inherited from Auditor
 Auditor (const std::string &name, ISvcLocator *svcloc)
 Constructor.
 
virtual ~Auditor ()
 Destructor.
 
StatusCode sysInitialize ()
 Initialization method invoked by the framework.
 
StatusCode sysFinalize ()
 Finalization method invoked by the framework.
 
virtual void beforeInitialize (INamedInterface *)
 
virtual void afterInitialize (INamedInterface *)
 
virtual void beforeReinitialize (INamedInterface *)
 
virtual void afterReinitialize (INamedInterface *)
 
virtual void beforeExecute (INamedInterface *)
 
virtual void afterExecute (INamedInterface *, const StatusCode &)
 
virtual void beforeFinalize (INamedInterface *)
 
virtual void afterFinalize (INamedInterface *)
 
virtual void beforeBeginRun (INamedInterface *)
 
virtual void afterBeginRun (INamedInterface *)
 
virtual void beforeEndRun (INamedInterface *)
 
virtual void afterEndRun (INamedInterface *)
 
virtual StatusCode finalize ()
 
virtual const std::stringname () const
 
virtual bool isEnabled () const
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service.
 
int outputLevel () const
 Retrieve the output level of current auditor.
 
void setOutputLevel (int level)
 Set the output level for current auditor.
 
SmartIF< ISvcLocator > & serviceLocator () const
 The standard service locator.
 
template<class T >
StatusCode service (const std::string &name, T *&svc, bool createIf=false) const
 Access a service by name, creating it if it doesn't already exist.
 
virtual StatusCode setProperty (const Property &p)
 Set a value of a property of an auditor.
 
virtual StatusCode setProperty (const std::string &s)
 Implementation of IProperty::setProperty.
 
virtual StatusCode setProperty (const std::string &n, const std::string &v)
 Implementation of IProperty::setProperty.
 
virtual StatusCode getProperty (Property *p) const
 Get the value of a property.
 
virtual const PropertygetProperty (const std::string &name) const
 Get the property by name.
 
virtual StatusCode getProperty (const std::string &n, std::string &v) const
 Implementation of IProperty::getProperty.
 
const std::vector< Property * > & getProperties () const
 Get all properties.
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
StatusCode setProperties ()
 Set the auditor's properties.
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property.
 

Private Member Functions

virtual void i_before (CustomEventTypeRef evt, const std::string &caller)
 Re-implement i_before to avoid monitoring the memory usage before a function.
 
virtual void i_printinfo (const std::string &msg, CustomEventTypeRef evt, const std::string &caller)
 Report the memory usage.
 
SmartIF< IChronoStatSvc > & statSvc ()
 

Private Attributes

SmartIF< IChronoStatSvcm_stat
 
double m_vSize
 vsize of the previous call to printinfo
 

Additional Inherited Members

- Public Types inherited from implements2< IAuditor, IProperty >
typedef implements2 base_class
 Typedef to this class.
 
typedef extend_interfaces2
< IAuditor, IProperty
extend_interfaces_base
 Typedef to the base of this class.
 
typedef
extend_interfaces_base::ext_iids 
interfaces
 MPL set of all the implemented interfaces.
 
- Protected Member Functions inherited from MemoryAuditor
virtual void i_after (CustomEventTypeRef evt, const std::string &caller, const StatusCode &sc)
 Default (catch-all) "after" Auditor hook.
 
- Static Protected Member Functions inherited from MemoryAuditor
static bool getProcInfo (procInfo &info)
 Get the process informations.
 
- Protected Attributes inherited from CommonAuditor
StringArrayProperty m_types
 
StringArrayProperty m_customTypes
 

Detailed Description

Just a minor modification of MemoryAuditor to allow the output memory statistics table to be printed.

Author
Vanya Belyaev
Marco Clemencic
Date
04/02/2001

Definition at line 15 of file MemStatAuditor.h.

Constructor & Destructor Documentation

MemStatAuditor::MemStatAuditor ( const std::string name,
ISvcLocator pSvcLocator 
)

local

Definition at line 19 of file MemStatAuditor.cpp.

:
MemoryAuditor(name, pSvcLocator), m_vSize(-1.)
{
}
MemStatAuditor::~MemStatAuditor ( )
virtual

Definition at line 24 of file MemStatAuditor.cpp.

{}

Member Function Documentation

void MemStatAuditor::i_before ( CustomEventTypeRef  evt,
const std::string caller 
)
privatevirtual

Re-implement i_before to avoid monitoring the memory usage before a function.

Reimplemented from MemoryAuditor.

Definition at line 39 of file MemStatAuditor.cpp.

{
// It's not interesting to monitor the memory usage before the methods.
}
void MemStatAuditor::i_printinfo ( const std::string msg,
CustomEventTypeRef  evt,
const std::string caller 
)
privatevirtual

Report the memory usage.

Reimplemented from MemoryAuditor.

Definition at line 43 of file MemStatAuditor.cpp.

{
// cannot be exactly 0
double deltaVSize = 0.00001;
procInfo info;
if (getProcInfo(info)) {
if (info.vsize > 0) {
if (m_vSize > 0){
deltaVSize = info.vsize - m_vSize;
}
// store the current VSize to be able to monitor the increment
m_vSize = info.vsize;
}
log << MSG::INFO << msg << " " << caller << " " << evt <<
" \tvirtual size = " << info.vsize << " MB" <<
" \tresident set size = " << info.rss << " MB" <<
" deltaVsize = " << deltaVSize << " MB" << endmsg;
}
// fill the stat for every call, not just when there is a change
// only monitor the increment in VSize
// Stat stv(statSvc(), caller + ":VMemUsage", info.vsize);
// Stat str(statSvc(), caller + ":RMemUsage", info.rss);
Stat sts(statSvc(), caller + ":VMem", deltaVSize);
}
StatusCode MemStatAuditor::initialize ( )
virtual

Reimplemented from Auditor.

Definition at line 26 of file MemStatAuditor.cpp.

{
if (UNLIKELY(sc.isFailure())) return sc;
m_stat = serviceLocator()->service("ChronoStatSvc");
if (UNLIKELY(!m_stat.get())) {
log << MSG::ERROR << "Cannot get ChronoStatSvc" << endmsg;
}
}
SmartIF<IChronoStatSvc>& MemStatAuditor::statSvc ( )
inlineprivate

Definition at line 27 of file MemStatAuditor.h.

{ return m_stat; }

Member Data Documentation

SmartIF<IChronoStatSvc> MemStatAuditor::m_stat
private

Definition at line 28 of file MemStatAuditor.h.

double MemStatAuditor::m_vSize
private

vsize of the previous call to printinfo

Definition at line 31 of file MemStatAuditor.h.


The documentation for this class was generated from the following files:
Generated at Wed Nov 28 2012 12:17:31 for Gaudi Framework, version v23r5 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004