18 #include "boost/format.hpp"
45 const std::string& tag )
87 const std::string& tag ,
98 m_stat -> stat( tag , flag ) ;
113 const std::string& group ,
114 const std::string& name )
134 : m_entity ( right.m_entity )
135 , m_tag ( right.m_tag )
136 , m_group ( right.m_group )
137 , m_stat ( right.m_stat )
138 , m_counter ( right.m_counter )
148 if (
this == &right ) {
return *this ; }
154 if ( 0 != stat ) { stat -> addRef() ; }
160 if ( 0 != counter ) { counter -> addRef() ; }
180 std::ostringstream ost ;
202 return o <<
boost::format(
" %|1$15s|::%|2$-15s| %|32t|%NULL%")
212 % (
"\"" +
m_tag +
"\"" ) ;
236 {
return stat.
print( stream ) ; }
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Small wrapper class for easy manipulation with generic counters and IStatSvc&ICounterSvc interface...
Create / access multi purpose counters.
StatEntity * counter() const
alternative access to underlying counter (for ICounterSvc::CounterObj)
virtual void stat(const StatTag &t, const StatFlag &f)=0
add statistical information to the entity , tagged by its name
StatEntity * m_entity
underlying counter
Stat operator+(const Stat &stat, const double value)
external operator for addition of Stat and a number
void reset()
reset the counters
const std::string & name() const
counter name
ICounterSvc * m_counter
Counter Service.
std::string m_tag
unique stat tag(name)
Stat(StatEntity *entity=0, const std::string &name="", const std::string &group="")
constructor from StatEntity, name and group :
IStatSvc * m_stat
Stat service.
std::string toString() const
representation as string
std::ostream & operator<<(std::ostream &stream, const Stat &stat)
output operator for the counter object
"Stat"-related part of interface IChronoStatSvc
The basic counter used for Monitoring purposes.
std::ostream & print(std::ostream &o=std::cout) const
printout to std::ostream
const std::string & group() const
counter group (for ICounterSvc)
Stat operator-(const Stat &stat, const double value)
external operator for subtraction of Stat and a number
Stat & operator=(const Stat &right)
Assignement operator.