Class OpenBsdHWDiskStore
- java.lang.Object
-
- oshi.hardware.common.AbstractHWDiskStore
-
- oshi.hardware.platform.unix.openbsd.OpenBsdHWDiskStore
-
- All Implemented Interfaces:
HWDiskStore
@ThreadSafe public final class OpenBsdHWDiskStore extends AbstractHWDiskStore
OpenBSD hard disk implementation.
-
-
Field Summary
Fields Modifier and Type Field Description private longcurrentQueueLengthprivate java.util.function.Supplier<java.util.List<java.lang.String>>iostatprivate java.util.List<HWPartition>partitionListprivate longreadBytesprivate longreadsprivate longtimeStampprivate longtransferTimeprivate longwriteBytesprivate longwrites
-
Constructor Summary
Constructors Modifier Constructor Description privateOpenBsdHWDiskStore(java.lang.String name, java.lang.String model, java.lang.String serial, long size)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetCurrentQueueLength()The length of the disk queue (#I/O's in progress).static java.util.List<HWDiskStore>getDisks()Gets the disks on this machine.java.util.List<HWPartition>getPartitions()The partitions on this disk.longgetReadBytes()The number of bytes read from the disklonggetReads()The number of reads from the disklonggetTimeStamp()The time this disk's statistics were updated.longgetTransferTime()The time spent reading or writing, in milliseconds.longgetWriteBytes()The number of bytes written to the disklonggetWrites()The number of writes to the diskprivate static java.util.List<java.lang.String>querySystatIostat()booleanupdateAttributes()Make a best effort to update all the statistics about the drive without needing to recreate the drive list.
-
-
-
Field Detail
-
iostat
private final java.util.function.Supplier<java.util.List<java.lang.String>> iostat
-
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
private java.util.List<HWPartition> partitionList
-
-
Method Detail
-
getDisks
public static java.util.List<HWDiskStore> getDisks()
Gets the disks on this machine.- Returns:
- a list of
HWDiskStoreobjects representing the disks
-
getReads
public long getReads()
Description copied from interface:HWDiskStoreThe number of reads from the disk- Returns:
- the reads
-
getReadBytes
public long getReadBytes()
Description copied from interface:HWDiskStoreThe number of bytes read from the disk- Returns:
- the bytes read
-
getWrites
public long getWrites()
Description copied from interface:HWDiskStoreThe number of writes to the disk- Returns:
- the writes
-
getWriteBytes
public long getWriteBytes()
Description copied from interface:HWDiskStoreThe number of bytes written to the disk- Returns:
- the bytes written
-
getCurrentQueueLength
public long getCurrentQueueLength()
Description copied from interface:HWDiskStoreThe 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:HWDiskStoreThe time spent reading or writing, in milliseconds.- Returns:
- the transfer time
-
getTimeStamp
public long getTimeStamp()
Description copied from interface:HWDiskStoreThe time this disk's statistics were updated.- Returns:
- the timeStamp, in milliseconds since the epoch.
-
getPartitions
public java.util.List<HWPartition> getPartitions()
Description copied from interface:HWDiskStoreThe partitions on this disk.- Returns:
- an
UnmodifiableListof the partitions on this drive.
-
updateAttributes
public boolean updateAttributes()
Description copied from interface:HWDiskStoreMake 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
-
querySystatIostat
private static java.util.List<java.lang.String> querySystatIostat()
-
-