Package oshi.hardware.platform.linux
Class LinuxHWDiskStore
java.lang.Object
oshi.hardware.common.AbstractHWDiskStore
oshi.hardware.platform.linux.LinuxHWDiskStore
- All Implemented Interfaces:
HWDiskStore
Linux hard disk implementation.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private long
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final org.slf4j.Logger
private static final String
private static final String
private static final String
private static final String
private List
<HWPartition> private long
private long
private static final int
private static final String
private static final String
private long
private long
private static final int
private static final int[]
private long
private long
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
LinuxHWDiskStore
(String name, String model, String serial, long size) -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
computeDiskStats
(LinuxHWDiskStore store, String devstat) long
The length of the disk queue (#I/O's in progress).private static String
static List
<HWDiskStore> getDisks()
Gets the disks on this machineprivate static List
<HWDiskStore> getDisks
(LinuxHWDiskStore storeToUpdate) private static String
getMountPointOfDmDevice
(String vgName, String lvName) private static String
getPartitionNameForDmDevice
(String vgName, String lvName) The partitions on this disk.long
The number of bytes read from the disklong
getReads()
The number of reads from the disklong
The time this disk's statistics were updated.long
The time spent reading or writing, in milliseconds.long
The number of bytes written to the disklong
The number of writes to the diskboolean
Make a best effort to update all the statistics about the drive without needing to recreate the drive list.
-
Field Details
-
LOG
private static final org.slf4j.Logger LOG -
BLOCK
- See Also:
-
DISK
- See Also:
-
PARTITION
- See Also:
-
STAT
- See Also:
-
SIZE
- See Also:
-
MINOR
- See Also:
-
MAJOR
- See Also:
-
ID_FS_TYPE
- See Also:
-
ID_FS_UUID
- See Also:
-
ID_MODEL
- See Also:
-
ID_SERIAL_SHORT
- See Also:
-
DM_UUID
- See Also:
-
DM_VG_NAME
- See Also:
-
DM_LV_NAME
- See Also:
-
LOGICAL_VOLUME_GROUP
- See Also:
-
SECTORSIZE
private static final int SECTORSIZE- See Also:
-
UDEV_STAT_ORDERS
private static final int[] UDEV_STAT_ORDERS -
UDEV_STAT_LENGTH
private static final int UDEV_STAT_LENGTH -
reads
private long reads -
readBytes
private long readBytes -
writes
private long writes -
writeBytes
private long writeBytes -
currentQueueLength
private long currentQueueLength -
transferTime
private long transferTime -
timeStamp
private long timeStamp -
partitionList
-
-
Constructor Details
-
LinuxHWDiskStore
-
-
Method Details
-
getReads
public long getReads()Description copied from interface:HWDiskStore
The number of reads from the disk- Returns:
- the reads
-
getReadBytes
public long getReadBytes()Description copied from interface:HWDiskStore
The number of bytes read from the disk- Returns:
- the bytes read
-
getWrites
public long getWrites()Description copied from interface:HWDiskStore
The number of writes to the disk- Returns:
- the writes
-
getWriteBytes
public long getWriteBytes()Description copied from interface:HWDiskStore
The number of bytes written to the disk- Returns:
- the bytes written
-
getCurrentQueueLength
public long getCurrentQueueLength()Description copied from interface:HWDiskStore
The length of the disk queue (#I/O's in progress). Includes I/O requests that have been issued to the device driver but have not yet completed. Not supported on macOS.- Returns:
- the current disk queue length
-
getTransferTime
public long getTransferTime()Description copied from interface:HWDiskStore
The time spent reading or writing, in milliseconds.- Returns:
- the transfer time
-
getTimeStamp
public long getTimeStamp()Description copied from interface:HWDiskStore
The time this disk's statistics were updated.- Returns:
- the timeStamp, in milliseconds since the epoch.
-
getPartitions
Description copied from interface:HWDiskStore
The partitions on this disk.- Returns:
- an
UnmodifiableList
of the partitions on this drive.
-
getDisks
Gets the disks on this machine- Returns:
- a list of
HWDiskStore
objects representing the disks
-
getDisks
-
updateAttributes
public boolean updateAttributes()Description copied from interface:HWDiskStore
Make a best effort to update all the statistics about the drive without needing to recreate the drive list. This method provides for more frequent periodic updates of individual drive statistics but may be less efficient to use if updating all drives. It will not detect if a removable drive has been removed and replaced by a different drive in between method calls.- Returns:
- True if the update was (probably) successful, false if the disk was not found
-
readMountsMap
-
computeDiskStats
-
getPartitionNameForDmDevice
-
getMountPointOfDmDevice
-
getDependentNamesFromHoldersDirectory
-