CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
stor::MonitorCollection Class Referenceabstract

#include <MonitorCollection.h>

Inheritance diagram for stor::MonitorCollection:
smproxy::DataRetrieverMonitorCollection stor::ConsumerMonitorCollection stor::DataSenderMonitorCollection stor::DQMEventMonitorCollection stor::FilesMonitorCollection stor::FragmentMonitorCollection stor::ResourceMonitorCollection stor::RunMonitorCollection stor::StateMachineMonitorCollection stor::StreamsMonitorCollection stor::ThroughputMonitorCollection

Public Types

typedef std::vector< std::pair
< std::string,
xdata::Serializable * > > 
InfoSpaceItems
 

Public Member Functions

void appendInfoSpaceItems (InfoSpaceItems &)
 
void calculateStatistics (const utils::TimePoint_t &now)
 
 MonitorCollection (const utils::Duration_t &updateInterval)
 
void reset (const utils::TimePoint_t &now)
 
void updateInfoSpaceItems ()
 
virtual ~MonitorCollection ()
 

Protected Member Functions

virtual void do_appendInfoSpaceItems (InfoSpaceItems &)
 
virtual void do_calculateStatistics ()=0
 
virtual void do_reset ()=0
 
virtual void do_updateInfoSpaceItems ()
 

Private Member Functions

 MonitorCollection (MonitorCollection const &)
 
MonitorCollectionoperator= (MonitorCollection const &)
 

Private Attributes

bool infoSpaceUpdateNeeded_
 
utils::TimePoint_t lastCalculateStatistics_
 
const utils::Duration_t updateInterval_
 

Detailed Description

An abstract collection of MonitoredQuantities

Author:
mommsen
Revision:
1.6
Date:
2011/03/07 15:31:32

Definition at line 25 of file MonitorCollection.h.

Member Typedef Documentation

typedef std::vector< std::pair<std::string, xdata::Serializable*> > stor::MonitorCollection::InfoSpaceItems

Definition at line 29 of file MonitorCollection.h.

Constructor & Destructor Documentation

stor::MonitorCollection::MonitorCollection ( const utils::Duration_t updateInterval)
explicit

Definition at line 10 of file MonitorCollection.cc.

10  :
11  updateInterval_(updateInterval),
12  lastCalculateStatistics_(boost::posix_time::not_a_date_time),
14  {}
utils::TimePoint_t lastCalculateStatistics_
const utils::Duration_t updateInterval_
virtual stor::MonitorCollection::~MonitorCollection ( )
inlinevirtual

Definition at line 36 of file MonitorCollection.h.

36 {};
stor::MonitorCollection::MonitorCollection ( MonitorCollection const &  )
private

Member Function Documentation

void stor::MonitorCollection::appendInfoSpaceItems ( InfoSpaceItems items)

Append the info space items to be published in the monitoring info space to the InfoSpaceItems

Definition at line 17 of file MonitorCollection.cc.

References do_appendInfoSpaceItems().

Referenced by smproxy::StatisticsReporter::collectInfoSpaceItems(), and stor::StatisticsReporter::collectInfoSpaceItems().

18  {
19  // do any operations that are common for all child classes
20 
22  }
virtual void do_appendInfoSpaceItems(InfoSpaceItems &)
void stor::MonitorCollection::calculateStatistics ( const utils::TimePoint_t now)

Calculates the statistics for all quantities

Definition at line 25 of file MonitorCollection.cc.

References do_calculateStatistics(), infoSpaceUpdateNeeded_, lastCalculateStatistics_, cmsPerfSuiteHarvest::now, and updateInterval_.

Referenced by smproxy::StatisticsReporter::calculateStatistics(), and stor::StatisticsReporter::calculateStatistics().

26  {
27  if ( lastCalculateStatistics_.is_not_a_date_time() ||
29  {
33  }
34  }
virtual void do_calculateStatistics()=0
utils::TimePoint_t lastCalculateStatistics_
const utils::Duration_t updateInterval_
virtual void stor::MonitorCollection::do_appendInfoSpaceItems ( InfoSpaceItems )
inlineprotectedvirtual
virtual void stor::MonitorCollection::do_calculateStatistics ( )
protectedpure virtual
virtual void stor::MonitorCollection::do_reset ( )
protectedpure virtual
virtual void stor::MonitorCollection::do_updateInfoSpaceItems ( )
inlineprotectedvirtual
MonitorCollection& stor::MonitorCollection::operator= ( MonitorCollection const &  )
private
void stor::MonitorCollection::reset ( const utils::TimePoint_t now)

Resets the monitored quantities

Definition at line 47 of file MonitorCollection.cc.

References do_reset(), infoSpaceUpdateNeeded_, lastCalculateStatistics_, seconds(), and updateInterval_.

Referenced by smproxy::StatisticsReporter::reset(), and stor::StatisticsReporter::reset().

48  {
49  do_reset();
50 
51  // Assure that the first update happens early.
52  // This is important for long update intervals.
55  }
double seconds()
virtual void do_reset()=0
utils::TimePoint_t lastCalculateStatistics_
const utils::Duration_t updateInterval_
void stor::MonitorCollection::updateInfoSpaceItems ( )

Update all values of the items put into the monitoring info space. The caller has to make sure that the info space where the items reside is locked and properly unlocked after the call.

Definition at line 37 of file MonitorCollection.cc.

References do_updateInfoSpaceItems(), and infoSpaceUpdateNeeded_.

Referenced by stor::StatisticsReporter::actionPerformed(), smproxy::StatisticsReporter::updateInfoSpace(), and stor::StatisticsReporter::updateInfoSpace().

38  {
40  {
42  infoSpaceUpdateNeeded_ = false;
43  }
44  }
virtual void do_updateInfoSpaceItems()

Member Data Documentation

bool stor::MonitorCollection::infoSpaceUpdateNeeded_
private

Definition at line 79 of file MonitorCollection.h.

Referenced by calculateStatistics(), reset(), and updateInfoSpaceItems().

utils::TimePoint_t stor::MonitorCollection::lastCalculateStatistics_
private

Definition at line 78 of file MonitorCollection.h.

Referenced by calculateStatistics(), and reset().

const utils::Duration_t stor::MonitorCollection::updateInterval_
private

Definition at line 77 of file MonitorCollection.h.

Referenced by calculateStatistics(), and reset().