lm::LoadMonitor::DriveStats::OneDriveStats Class Reference

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


Public Member Functions

 OneDriveStats (const std::string &line)
bool IsDriveDevice (void) const
 Test if this drive is physical drive or partition.
bool IsIDE (void) const
 Is this device connceted through the IDE bus?
bool IsSCSI (void) const
 Is this device connected through the SCSI bus?

Data Fields

int major
 Major device number.
int minor
 Minor device number.
char name [DRIVE_NAME_LENGTH]
 Device name.
unsigned long stat_fields [COLUMN_COUNT]
 Stats fields.

Static Public Attributes

static const size_t DRIVE_NAME_LENGTH = 16
 Length of the device name.
static const size_t COLUMN_COUNT = 11
 Total number of data columns for each drive (2.6.0+).
static const long SECTOR_SIZE = 512
 Size of the sector in bytes.
static const size_t READS_ISSUED_COUNT = 0
 Total number of the reads.
static const size_t READS_MERGED = 1
 Total number of merged reads.
static const size_t READ_SECTORS = 2
 Total number of sectors read.
static const size_t READ_MILLISECONDS = 3
 Total time spent reading data from the drive.
static const size_t WRITES_COMPLETED = 4
 Total number of writes completed.
static const size_t WRITES_MERGED = 5
 Total number of merged writes.
static const size_t WRITE_SECTORS = 6
 Total number of sectors written.
static const size_t WRITE_MILLISECONDS = 7
 Total time spent writing.
static const size_t IOS_IN_PROGRESS = 8
 Number of IO operations in progress.
static const size_t IO_MILLISECONDS = 9
 Total time spent doing IO operations.
static const size_t IO_WEIGHTED_MILLISECONDS = 10
 Weighted time spent doing IO operations.


Detailed Description

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

All field except ninth one (IOS_IN_PROGRESS) are cummulative since last boot. More details about the diskstats file can be found in the kernel sources in Documenttation/iostats.txt file.


Constructor & Destructor Documentation

lm::LoadMonitor::DriveStats::OneDriveStats::OneDriveStats ( const std::string &  line  ) 

Parameters:
line One line from the /proc/diskstats file.


Member Function Documentation

bool lm::LoadMonitor::DriveStats::OneDriveStats::IsDriveDevice ( void   )  const

Test if this drive is physical drive or partition.

This will test if device that this object represents is device of the disk drive of if it is partition. Drive devices have names like "hda", "hdb", etc., while paritions have names like "hda0", "hda1", etc. That is, this method tests if name of the device ends with a number.

Returns:
true if name of the device does not end with a number, false otherwise.

bool lm::LoadMonitor::DriveStats::OneDriveStats::IsIDE ( void   )  const

Is this device connceted through the IDE bus?

Test if device represented by this object is connected through the IDE bus. Note that this tests only for IDE disks, that is devices with names beginning with "hd".

Returns:
true if this device is an IDE disk, false otherwise.

bool lm::LoadMonitor::DriveStats::OneDriveStats::IsSCSI ( void   )  const

Is this device connected through the SCSI bus?

Test if device represented by this object is connected through the SCSI bus. Note that this tests only for SCSI disks, that is devices with names beginning with "sd".

Returns:
true if this device is a SCSI disk, false otherwise.


Field Documentation

const size_t lm::LoadMonitor::DriveStats::OneDriveStats::COLUMN_COUNT = 11 [static]

Total number of data columns for each drive (2.6.0+).

const size_t lm::LoadMonitor::DriveStats::OneDriveStats::DRIVE_NAME_LENGTH = 16 [static]

Length of the device name.

const size_t lm::LoadMonitor::DriveStats::OneDriveStats::IO_MILLISECONDS = 9 [static]

Total time spent doing IO operations.

const size_t lm::LoadMonitor::DriveStats::OneDriveStats::IO_WEIGHTED_MILLISECONDS = 10 [static]

Weighted time spent doing IO operations.

const size_t lm::LoadMonitor::DriveStats::OneDriveStats::IOS_IN_PROGRESS = 8 [static]

Number of IO operations in progress.

int lm::LoadMonitor::DriveStats::OneDriveStats::major

Major device number.

int lm::LoadMonitor::DriveStats::OneDriveStats::minor

Minor device number.

char lm::LoadMonitor::DriveStats::OneDriveStats::name[DRIVE_NAME_LENGTH]

Device name.

const size_t lm::LoadMonitor::DriveStats::OneDriveStats::READ_MILLISECONDS = 3 [static]

Total time spent reading data from the drive.

const size_t lm::LoadMonitor::DriveStats::OneDriveStats::READ_SECTORS = 2 [static]

Total number of sectors read.

const size_t lm::LoadMonitor::DriveStats::OneDriveStats::READS_ISSUED_COUNT = 0 [static]

Total number of the reads.

const size_t lm::LoadMonitor::DriveStats::OneDriveStats::READS_MERGED = 1 [static]

Total number of merged reads.

const long lm::LoadMonitor::DriveStats::OneDriveStats::SECTOR_SIZE = 512 [static]

Size of the sector in bytes.

unsigned long lm::LoadMonitor::DriveStats::OneDriveStats::stat_fields[COLUMN_COUNT]

Stats fields.

const size_t lm::LoadMonitor::DriveStats::OneDriveStats::WRITE_MILLISECONDS = 7 [static]

Total time spent writing.

const size_t lm::LoadMonitor::DriveStats::OneDriveStats::WRITE_SECTORS = 6 [static]

Total number of sectors written.

const size_t lm::LoadMonitor::DriveStats::OneDriveStats::WRITES_COMPLETED = 4 [static]

Total number of writes completed.

const size_t lm::LoadMonitor::DriveStats::OneDriveStats::WRITES_MERGED = 5 [static]

Total number of merged writes.


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