lm::LoadMonitor Class Reference

Collects data about current system utilization. More...

#include <LoadMonitor.h>


Public Member Functions

 LoadMonitor (void)
 Ctor.
 ~LoadMonitor (void)
 Dtor.
bool Initialize (void)
 Initialize all counters.
bool Terminate (void)
 Free all resources and disconnect from WMI provider.
LoadSample TakeSample (void)
 Take performance sample.
HardwareDescription GetHardwareDescription (void)
 Get hardware description.

Private Member Functions

LoadMonitoroperator= (LoadMonitor &)
 Assignment.
 LoadMonitor (const LoadMonitor &)
 Prevent copying of the monitor.
void LogInfo (const char *message) const
 Log info message to the output.
void LogError (const char *message) const
 Log error message to the output.
unsigned long long GetTSC (void) const
 Get CPU TSC.

Static Private Member Functions

static unsigned long long GetSampleTime ()
 Get current time in 100 ns intervals since Windows epoch.

Private Attributes

MemoryStats memory
 Memory stats collector.
ProcessorStats processor
 Processor stats collector.
NetworkStats network
 Network stats collector.
SystemStats system
 System stats collector.
DriveStats drive
 Drive stats collector.

Data Structures

class  DriveStats
 Collects data about drive usage on the host. More...
class  MemoryStats
 Collects data about memory usage. More...
class  NetworkStats
 Collects data about network traffic on the computer. More...
class  ProcessorStats
 Collects data about processor usage. More...
class  StatsProvider
 Helper class which provides base for all stats providers. More...
class  SystemStats
 Collects various data about current system. More...


Detailed Description

Collects data about current system utilization.

This class collects all data about system utilization. Most of the data are read from the files in /proc directory. Kernel 2.5.70 or newer is required for all features to work. On older kernels some data may not be available.


Constructor & Destructor Documentation

lm::LoadMonitor::LoadMonitor ( void   ) 

Ctor.

lm::LoadMonitor::~LoadMonitor ( void   ) 

Dtor.

lm::LoadMonitor::LoadMonitor ( const LoadMonitor  )  [inline, private]

Prevent copying of the monitor.


Member Function Documentation

HardwareDescription lm::LoadMonitor::GetHardwareDescription ( void   ) 

Get hardware description.

Returns:
Description of the hardware parts that are being monitored by the monitor.

unsigned long long lm::LoadMonitor::GetSampleTime ( void   )  [static, private]

Get current time in 100 ns intervals since Windows epoch.

This method uses clock_gettime function as a primary source of the time information. This function is available only on newer kernels (2.6) with sufficiently new libc (version 6 works fine).

Returns:
Number of 100 ns intervals since 1.1. 1601.

unsigned long long lm::LoadMonitor::GetTSC ( void   )  const [inline, private]

Get CPU TSC.

Returns:
Timestamp counter of the CPU on which current thread is running.

bool lm::LoadMonitor::Initialize ( void   ) 

Initialize all counters.

Returns:
true on success, false otherwise.

void lm::LoadMonitor::LogError ( const char *  message  )  const [private]

Log error message to the output.

Parameters:
message Message to write out.

void lm::LoadMonitor::LogInfo ( const char *  message  )  const [private]

Log info message to the output.

Parameters:
message Message to write out.

LoadMonitor& lm::LoadMonitor::operator= ( LoadMonitor  )  [inline, private]

Assignment.

LoadSample lm::LoadMonitor::TakeSample ( void   ) 

Take performance sample.

Returns:
Sample containing data about current system utilization.

bool lm::LoadMonitor::Terminate ( void   ) 

Free all resources and disconnect from WMI provider.

Returns:
true on success, false otherwise.


Field Documentation

DriveStats lm::LoadMonitor::drive [private]

Drive stats collector.

MemoryStats lm::LoadMonitor::memory [private]

Memory stats collector.

NetworkStats lm::LoadMonitor::network [private]

Network stats collector.

ProcessorStats lm::LoadMonitor::processor [private]

Processor stats collector.

SystemStats lm::LoadMonitor::system [private]

System stats collector.


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