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. |
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.
lm::LoadMonitor::DriveStats::OneDriveStats::OneDriveStats | ( | const std::string & | line | ) |
line | One line from the /proc/diskstats file. |
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.
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".
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".
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.
Major device number.
Minor device number.
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.
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.