lm::LoadMonitor Class Reference

Load Monitor which collects performance data about computer. 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 GetSampleTime () const
 Get current time in 100 ns intervals since Windows epoch.
unsigned long long GetTSC (void) const
 Get CPU TSC.

Private Attributes

IWbemServices * services
 WMI Services.
IWbemRefresher * refresher
 Data refresher.
ProcessorEnumCache processor
 CPU data cache.
MemoryEnumCache memory
 Memory data cache.
NetworkEnumCache network
 Network data cache.
DriveEnumCache drive
 Drive data cache.
SystemEnumCache system
 System data cache.

Data Structures

class  DriveEnumCache
 Cache for drive releated data. More...
class  MemoryEnumCache
 Cache for memory monitoring data. More...
class  NetworkEnumCache
 Cache for network monitoring data. More...
class  PerformanceCounterEnumCache
 Base class for enumerator cache. More...
class  ProcessorEnumCache
 Cache for data related to processor usage. More...
class  SystemEnumCache
 Cache for system related counters. More...


Detailed Description

Load Monitor which collects performance data about computer.

WMI Hi-Perf data providers are used to collect all data. On WindowsXP and newer "formatted counters" are used. On older systems "raw counters" are used.


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:
HardwareDescription object with names of drives and network adapters that are being monitored by the library.

unsigned long long lm::LoadMonitor::GetSampleTime (  )  const [private]

Get current time in 100 ns intervals since Windows epoch.

Returns:
Current time in 100ns intervals since Windows epoch.

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

Get CPU TSC.

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

bool lm::LoadMonitor::Initialize ( void   ) 

Initialize all counters.

Connect to the WMI provider via COM and initialize all required resources. This will also add performance counters to the refresher. Error messages are written to the log file.

Returns:
true on success, false otherwise.

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

Log error message to the output.

Writes error message to the standard output (if logging is enabled). Message is prepended with current time and date and text "ERROR". Each message is written on a new line.

Parameters:
message Message to write to the output.

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

Log info message to the output.

Writes info message to the standard output (if logging is enabled). Message is prepended with current time and date and text "INFO". Each message is written on a new line.

Parameters:
message Message to write to the output.

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

Assignment.

LoadSample lm::LoadMonitor::TakeSample ( void   ) 

Take performance sample.

Request new data from WMI provider and store it in LoadSample.

Returns:
Sample containing data queried from the system. If an error occured, sample may not contain all data. However it is quarantee, that it will contain at least timestamp and TSC.

bool lm::LoadMonitor::Terminate ( void   ) 

Free all resources and disconnect from WMI provider.


Field Documentation

DriveEnumCache lm::LoadMonitor::drive [private]

Drive data cache.

MemoryEnumCache lm::LoadMonitor::memory [private]

Memory data cache.

NetworkEnumCache lm::LoadMonitor::network [private]

Network data cache.

ProcessorEnumCache lm::LoadMonitor::processor [private]

CPU data cache.

IWbemRefresher* lm::LoadMonitor::refresher [private]

Data refresher.

IWbemServices* lm::LoadMonitor::services [private]

WMI Services.

SystemEnumCache lm::LoadMonitor::system [private]

System data cache.


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