lm::LoadMonitor::ProcessorStats Class Reference

Collects data about processor usage. More...

Inheritance diagram for lm::LoadMonitor::ProcessorStats:

lm::LoadMonitor::StatsProvider

Public Member Functions

 ProcessorStats (void)
 Constructor.
virtual ~ProcessorStats (void)
 Destructor.
virtual bool QueryData (LoadSample &target)
 Query data and store them in the sample.
virtual bool QueryData (HardwareDescription &target)
 Query data descriptions and store them.

Private Attributes

std::vector< OneCpuStatscpus
 Cached stats for each cpu from previous run.

Data Structures

class  OneCpuStats
 Data read from /proc/stat for on CPU. More...

Detailed Description

Collects data about processor usage.


Constructor & Destructor Documentation

lm::LoadMonitor::ProcessorStats::ProcessorStats ( void   ) 

Constructor.

This will parse /proc/stat file and determine number of processors. It is assumed, that this number does not change while monitor is running (well, hot-swap processors are not that common :) ).

lm::LoadMonitor::ProcessorStats::~ProcessorStats ( void   )  [virtual]

Destructor.


Member Function Documentation

bool lm::LoadMonitor::ProcessorStats::QueryData ( HardwareDescription description  )  [virtual]

Query data descriptions and store them.

Reads data about the processors from the /proc/stat file.

Parameters:
description Structure which will receive data collected by this provider.
Returns:
true on success, false otherwise.

Implements lm::LoadMonitor::StatsProvider.

bool lm::LoadMonitor::ProcessorStats::QueryData ( LoadSample sample  )  [virtual]

Query data and store them in the sample.

This will parse /proc/stat file and extract data about all processors. If at least one sample has been taken prior this call, statistics will be calculated.

Parameters:
sample Structure which will receive data collected by this provider.
Returns:
true on success, false otherwise.

Implements lm::LoadMonitor::StatsProvider.


Field Documentation

std::vector< OneCpuStats > lm::LoadMonitor::ProcessorStats::cpus [private]

Cached stats for each cpu from previous run.


The documentation for this class was generated from the following files:
Generated on Tue Dec 19 17:43:49 2006 for Load Monitor for Linux by  doxygen 1.4.7