Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages

LocDynamicInfo Class Reference

#include <LocDynamicInfo.hpp>

Collaboration diagram for LocDynamicInfo:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LocDynamicInfo (LocStaticInfo &_lsi, float threshold)
bool hadSignificantChange ()
long getFreeRAM () const
long getFreeSwap () const
long getFsFree () const
long getFilesFree () const
long getFsTotal () const
long getFilesTotal () const
const char * getCpuUsage () const

Private Member Functions

void update ()
void testChange ()
string strUtilization () const

Private Attributes

long freeRAM
long freeSwap
long fsFree
long filesFree
long fsTotal
long filesTotal
float currCpuUsage
long prevFreeRAM
long prevFreeSwap
long prevFsFree
long prevFilesFree
long prevFsTotal
long prevFilesTotal
float prevCpuUsage
float threshold
LocStaticInfolsi
CpuUsagecpuUsage

Detailed Description

LocDynamicInfo - Collects system's dynamic information.

LocDynamicInfo queries the underlying OS for dynamic machine information, such as idle percentage of CPU, disk and memory. Currently, it only works in Linux, mainly due to the fact that there is no standardized way of getting this kind of information across different platforms.

Author:
Andrei Goldchleger


Constructor & Destructor Documentation

LocDynamicInfo::LocDynamicInfo LocStaticInfo _lsi,
float  threshold
 

Builds a LocDynamicInfo object

Parameters:
_lsi - Reference to a LOcalStaticInfo object(needed in order to calculate percentages of available resources).
threshold - percentage of change that, when applied to subjects being measured(such as CPU), makes a given change significant (that is, one that should be reported to other parts of the system)


Member Function Documentation

const char* LocDynamicInfo::getCpuUsage  )  const [inline]
 

Returns:
total available CPU usage

long LocDynamicInfo::getFilesFree  )  const [inline]
 

Returns:
available filenodes

long LocDynamicInfo::getFilesTotal  )  const [inline]
 

Returns:
total available filenodes

long LocDynamicInfo::getFreeRAM  )  const [inline]
 

Returns:
free RAM

long LocDynamicInfo::getFreeSwap  )  const [inline]
 

Returns:
free swap

long LocDynamicInfo::getFsFree  )  const [inline]
 

Returns:
available disk space

long LocDynamicInfo::getFsTotal  )  const [inline]
 

Returns:
total available disk space (for the user executing the LRM)

bool LocDynamicInfo::hadSignificantChange  ) 
 

Reports if a significant change in resource availability has ocurred.

A significant change is considered to be any variation in resource availability (CPU,Phys Memory, Swap) that exceeds the threshold (the one set at construction time).

string LocDynamicInfo::strUtilization  )  const [private]
 

get CPU utilization.

Returns:
CPU utilization as a string

void LocDynamicInfo::testChange  )  [private]
 

Tests if a significant change happened.

void LocDynamicInfo::update  )  [private]
 

Updates dynamic information.


Member Data Documentation

CpuUsage& LocDynamicInfo::cpuUsage [private]
 

Reference to a CpuUsage measuring object

float LocDynamicInfo::currCpuUsage [private]
 

holds current averaged CPU utilization

long LocDynamicInfo::filesFree [private]
 

free File nodes in filesystem

long LocDynamicInfo::filesTotal [private]
 

total filenodes in filesystem

long LocDynamicInfo::freeRAM [private]
 

free RAM space

long LocDynamicInfo::freeSwap [private]
 

free swap space

long LocDynamicInfo::fsFree [private]
 

free disk space

long LocDynamicInfo::fsTotal [private]
 

total available disk space(for the user executing the LRM)

LocStaticInfo& LocDynamicInfo::lsi [private]
 

reference to static info (to calculate percentages)

float LocDynamicInfo::prevCpuUsage [private]
 

previously averaged CPU utilization

long LocDynamicInfo::prevFilesFree [private]
 

previously available filenodes

long LocDynamicInfo::prevFilesTotal [private]
 

previously available filenodes in the filesystem

long LocDynamicInfo::prevFreeRAM [private]
 

RAM availability at previous measurement

long LocDynamicInfo::prevFreeSwap [private]
 

swap memory availability at previous measurement

long LocDynamicInfo::prevFsFree [private]
 

free disk space at previous measurement

long LocDynamicInfo::prevFsTotal [private]
 

previously available disk space

float LocDynamicInfo::threshold [private]
 

percentage that makes a change significant


The documentation for this class was generated from the following files:
Generated on Mon Sep 6 16:13:17 2004 by doxygen 1.3.3