Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

StatsMgr Class Reference

#include <StatsMgr.h>

List of all members.


Detailed Description

The StatsMgr class implements a statistics manager.

StatsMgr contains a container that hold all the statistics and provide RW lock to protest the data structure.


Public Member Functions

Statistics copyStats ()
 Copy the whole Stats structure.
TSStats copyTSStats (StatisticsName name, int32 window_size=0, TimeSec precision=0, TimeStamp time_stamp=0) throw ( Statistics::Error )
 Copy TSStats according to the given parameters.
TSStats copyTSStats (StatisticsName name, IDVect ids, int32 window_size=0, TimeSec precision=0, TimeStamp time_stamp=0) throw ( Statistics::Error )
 Copy TSStats with given object names.
FixLenTimeSeries copyStatistics (StatisticsName name, IDType id, int32 window_size=0, TimeSec precision=0, TimeStamp time_stamp=0) throw ( Statistics::Error, TSStats::Error )
 Copy statistics of an given object.
void addTSStats (StatisticsName name, int32 window_size, TimeSec precision, const IDVect &ids)
 Adds Empty TSStats with given name, precision, window_size, and object IDs.
bool hasTSStats (StatisticsName name)
void addEmptyStatistics (StatisticsName name, IDType id)
 Add an empty FixLenTimeSeries with given name and ID.
void deleteStatistics (StatisticsName name, IDType id)
 Delete a FixLenTimeSeries with given name and ID.
void readLock ()
 Get a read lock of the statistics.
void readUnlock ()
 Release the read lock.
void writeLock ()
 Get a write lock of the statistics.
void writeUnlock ()
 Release the write lock.
const StatisticsgetStats () const
 Returns the Stats.
StatisticsgetStats ()
 Returns the Stats.


Member Function Documentation

void StatsMgr::addEmptyStatistics StatisticsName  name,
IDType  id
 

Add an empty FixLenTimeSeries with given name and ID.

(locking/unlocking has been implemented inside the function)

Parameters:
name the name of the statistics
id the id of the given object

void StatsMgr::addTSStats StatisticsName  name,
int32  window_size,
TimeSec  precision,
const IDVect ids
 

Adds Empty TSStats with given name, precision, window_size, and object IDs.

(locking/unlocking has been implemented inside the function)

Parameters:
name the name of the statistics
window_size the window size of the statistics
precision the precision of the statistics
ids the ids of the given objects

FixLenTimeSeries StatsMgr::copyStatistics StatisticsName  name,
IDType  id,
int32  window_size = 0,
TimeSec  precision = 0,
TimeStamp  time_stamp = 0
throw ( Statistics::Error, TSStats::Error )
 

Copy statistics of an given object.

If window_size/precision/time_stamp is zero, then the default value is used. Otherwise, the returned data are resamples according to the given parameters.

(locking/unlocking has been implemented inside the function)

Parameters:
name the name of the statistics
id the id of the given object
window_size the window size of the returned statistics
precision the precision of the returned statistics
time_stamp the time stamp of the latest sample
Exceptions:
Statistics::STATISTICS_NAME_NOT_FOUND if the name is invalid.
TSStats::ID_NOT_FOUND if the given id is not valid

Statistics StatsMgr::copyStats  ) 
 

Copy the whole Stats structure.

(locking/unlocking has been implemented inside the function)

TSStats StatsMgr::copyTSStats StatisticsName  name,
IDVect  ids,
int32  window_size = 0,
TimeSec  precision = 0,
TimeStamp  time_stamp = 0
throw ( Statistics::Error )
 

Copy TSStats with given object names.

If window_size/precision/time_stamp is zero, then the default value is used. Otherwise, the returned data are resamples according to the given parameters.

(locking/unlocking has been implemented inside the function)

Parameters:
name the name of the statistics
ids the ids of the given objects
window_size the window size of the returned statistics
precision the precision of the returned statistics
time_stamp the time stamp of the latest sample
Exceptions:
Statistics::STATISTICS_NAME_NOT_FOUND if the name is invalid.
TSStats::ID_NOT_FOUND if the given id is not valid

TSStats StatsMgr::copyTSStats StatisticsName  name,
int32  window_size = 0,
TimeSec  precision = 0,
TimeStamp  time_stamp = 0
throw ( Statistics::Error )
 

Copy TSStats according to the given parameters.

If window_size/precision/time_stamp is zero, then the default value is used. Otherwise, the returned data are resamples according to the given parameters.

(locking/unlocking has been implemented inside the function)

Parameters:
name the name of the statistics
window_size the window size of the returned statistics
precision the precision of the returned statistics
time_stamp the time stamp of the latest sample
Exceptions:
Statistics::STATISTICS_NAME_NOT_FOUND if the name is invalid.

void StatsMgr::deleteStatistics StatisticsName  name,
IDType  id
 

Delete a FixLenTimeSeries with given name and ID.

(locking/unlocking has been implemented inside the function)

Parameters:
name the name of the statistics
id the id of the given object

Statistics& StatsMgr::getStats  ) 
 

Returns the Stats.

Must read lock before this functon and read unlock after this function

const Statistics& StatsMgr::getStats  )  const
 

Returns the Stats.

Must read lock before this functon and read unlock after this function

bool StatsMgr::hasTSStats StatisticsName  name  ) 
 

void StatsMgr::readLock  ) 
 

Get a read lock of the statistics.

void StatsMgr::readUnlock  ) 
 

Release the read lock.

void StatsMgr::writeLock  ) 
 

Get a write lock of the statistics.

void StatsMgr::writeUnlock  ) 
 

Release the write lock.


The documentation for this class was generated from the following files:
Generated on Fri Nov 12 15:15:24 2004 for Borealis by doxygen 1.3.8