lm::LoadMonitor::DriveStats Class Reference

Collects data about drive usage on the host. More...

Inheritance diagram for lm::LoadMonitor::DriveStats:

lm::LoadMonitor::StatsProvider

Public Member Functions

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

Private Attributes

int kernel_version
 Kernel version code.
std::vector< std::pair< long,
long > > 
data
 Stats for the IDE drives.
unsigned long long last_time
 Timestamp of the last measurement.

Data Structures

class  OneDriveStats
 Stores data about one disk drive from /proc/diskstats file. More...

Detailed Description

Collects data about drive usage on the host.


Constructor & Destructor Documentation

lm::LoadMonitor::DriveStats::DriveStats ( void   ) 

Constructor.

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

Destructor.


Member Function Documentation

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

Collect data and store their descriptions.

This will read names of all IDE drives from the /proc/diskstats file. Works on kernel newer than 2.5.69.

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

Implements lm::LoadMonitor::StatsProvider.

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

Collect data and store them in the sample.

Reads data from the /proc/diskstats file. This file is available only on kernels newer than 2.5.69. For older kernels no data is available.

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< std::pair< long, long > > lm::LoadMonitor::DriveStats::data [private]

Stats for the IDE drives.

First item of the pair is number of sectors read, second is number of sectors written.

int lm::LoadMonitor::DriveStats::kernel_version [private]

Kernel version code.

unsigned long long lm::LoadMonitor::DriveStats::last_time [private]

Timestamp of the last measurement.


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