FountainNodes::Statistics Class Reference
[Fountain server]

Class implementing the NodeData statistics policy to maintain node statistics about a Fountain node. More...

#include <NodeData.h>

Inheritance diagram for FountainNodes::Statistics:

SupportsNodeState List of all members.

Public Member Functions

void checkForStaleData (const time_t &staleDataLimit)
 Check if this object's data has been updated recently, if not change it's NodeState to down.
void update (BambooLib::XMLElement *nodeInfo)
 Update this NodeData object's dynamic resource usage.

Protected Member Functions

 Statistics (const std::string &myid)
 Constructor.
 ~Statistics ()
 Protected destructor since this is a policy class.
bool supportGetElement (const std::string &getElementName) const
 Test whether or not the named Get element is supported.
bool satisfiesWhereElement (const std::string &name, BambooLib::RMAP_Relation_Operator_Type op, const std::string &value) const
 Test the named Where element using the provided operator and value to see if it matches our statistics.
void appendInfo (XMLElementListPtr getList, BambooLib::XMLElement *nodeXML) const
 Append this NodeData object's resource statistics to an XML message using the provided parameters.

Private Member Functions

void parseNodeInfoElement (BambooLib::XMLElement *nodeInfo)
 Parse the node query response.

Private Attributes

std::vector< std::string > supportedGetElements_
 A vector of strings containing the names of the supported Get elements.
const std::string id_
 Unique ID of this node.
time_t lastUpdated_
std::string arch_
std::string opsys_
unsigned int numProcs_
double configuredMemory_
double configuredSwap_
double availableMemory_
double availableSwap_
double cpuUsage_
BambooLib::RMAP_UnitType configuredMemoryUnits_
BambooLib::RMAP_UnitType configuredSwapUnits_
BambooLib::RMAP_UnitType availableMemoryUnits_
BambooLib::RMAP_UnitType availableSwapUnits_

Detailed Description

Class implementing the NodeData statistics policy to maintain node statistics about a Fountain node.


Member Function Documentation

void Statistics::appendInfo XMLElementListPtr  getList,
BambooLib::XMLElement nodeXML
const [protected]
 

Append this NodeData object's resource statistics to an XML message using the provided parameters.

Parameters:
[in] getList The list of Get XML elements
[in] nodeXML The XML element to append the information to
Precondition:
Every Get element in the getList is supported

nodeXML != NULL

void Statistics::parseNodeInfoElement BambooLib::XMLElement nodeInfo  )  [private]
 

Parse the node query response.

Exceptions:
FountainException if an invalid NodeId is encountered

bool Statistics::satisfiesWhereElement const std::string &  name,
BambooLib::RMAP_Relation_Operator_Type  op,
const std::string &  value
const [protected]
 

Test the named Where element using the provided operator and value to see if it matches our statistics.

Parameters:
[in] name The name of the Where element to test
[in] op The relation operator to use when c omparing our value to the passed in value
[in] value The value to test against
Return values:
bool true if the comparison passes, false otherwise

bool Statistics::supportGetElement const std::string &  getElementName  )  const [protected]
 

Test whether or not the named Get element is supported.

Parameters:
[in] getElementName The name of the Get element
Return values:
bool true if the get element is supported, false otherwise

void Statistics::update BambooLib::XMLElement nodeInfo  ) 
 

Update this NodeData object's dynamic resource usage.

Parameters:
[in] nodeInfo The XMLElement containing this node's resource usage in the SSSRMAP message specification


Member Data Documentation

std::string FountainNodes::Statistics::arch_ [private]
 

Architecture of this node's processors

double FountainNodes::Statistics::availableMemory_ [private]
 

Amount of available memory

BambooLib::RMAP_UnitType FountainNodes::Statistics::availableMemoryUnits_ [private]
 

Available memory units

double FountainNodes::Statistics::availableSwap_ [private]
 

Amount of available swap space

BambooLib::RMAP_UnitType FountainNodes::Statistics::availableSwapUnits_ [private]
 

Available swap units

double FountainNodes::Statistics::configuredMemory_ [private]
 

Amount of configured memory

BambooLib::RMAP_UnitType FountainNodes::Statistics::configuredMemoryUnits_ [private]
 

Configured memory units

double FountainNodes::Statistics::configuredSwap_ [private]
 

Amount of configured swap space

BambooLib::RMAP_UnitType FountainNodes::Statistics::configuredSwapUnits_ [private]
 

Configured swap units

double FountainNodes::Statistics::cpuUsage_ [private]
 

Percentage of the CPU(s) that are utilized, ranges from 0 to 1.0 inclusive

time_t FountainNodes::Statistics::lastUpdated_ [private]
 

The time this object was last updated

unsigned int FountainNodes::Statistics::numProcs_ [private]
 

Number of configured processors

std::string FountainNodes::Statistics::opsys_ [private]
 

Operating system


The documentation for this class was generated from the following files:
Generated on Wed Mar 8 14:43:33 2006 for Fountain by  doxygen 1.4.6