#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 | |
LoadMonitor & | operator= (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... |
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.
lm::LoadMonitor::LoadMonitor | ( | void | ) |
Ctor.
lm::LoadMonitor::~LoadMonitor | ( | void | ) |
Dtor.
lm::LoadMonitor::LoadMonitor | ( | const LoadMonitor & | ) | [inline, private] |
Prevent copying of the monitor.
HardwareDescription lm::LoadMonitor::GetHardwareDescription | ( | void | ) |
Get hardware description.
unsigned long long lm::LoadMonitor::GetSampleTime | ( | ) | const [private] |
Get current time in 100 ns intervals since Windows epoch.
unsigned long long lm::LoadMonitor::GetTSC | ( | void | ) | const [inline, private] |
Get CPU TSC.
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.
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.
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.
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.
bool lm::LoadMonitor::Terminate | ( | void | ) |
Free all resources and disconnect from WMI provider.
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.