Class AbstractHWDiskStore
java.lang.Object
oshi.hardware.common.AbstractHWDiskStore
- All Implemented Interfaces:
HWDiskStore
- Direct Known Subclasses:
AixHWDiskStore, FreeBsdHWDiskStore, LinuxHWDiskStore, MacHWDiskStore, NetBsdHWDiskStore, SolarisHWDiskStore, WindowsHWDiskStore
Common methods for platform HWDiskStore classes
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractHWDiskStore(String name, String model, String serial, long size) Creates an AbstractHWDiskStore with unknown disk type.protectedAbstractHWDiskStore(String name, String model, String serial, long size, String diskType) Creates an AbstractHWDiskStore. -
Method Summary
Modifier and TypeMethodDescriptionlongThe length of the disk queue (#I/O's in progress).The type of the disk, such as SSD, HDD, Removable, Virtual, or Unknown.getModel()The disk modelgetName()The disk nameThe partitions on this disk.longThe number of bytes read from the disklonggetReads()The number of reads from the diskThe disk serial number, if available.longgetSize()The size of the disklongThe time this disk's statistics were updated.longThe time spent reading or writing, in milliseconds.longThe number of bytes written to the disklongThe number of writes to the diskprotected voidsetCurrentQueueLength(long currentQueueLength) Sets the current queue length.protected voidsetDiskStats(long reads, long readBytes, long writes, long writeBytes, long currentQueueLength, long transferTime, long timeStamp) Sets the disk statistics.protected voidsetPartitionList(List<HWPartition> partitionList) Sets the partition list.protected voidsetReadBytes(long readBytes) Sets the read bytes.protected voidsetReads(long reads) Sets the reads.protected voidsetTimeStamp(long timeStamp) Sets the timestamp.protected voidsetTransferTime(long transferTime) Sets the transfer time.protected voidsetWriteBytes(long writeBytes) Sets the write bytes.protected voidsetWrites(long writes) Sets the writes.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface HWDiskStore
updateAttributesModifier and TypeMethodDescriptionbooleanMake a best effort to update all the statistics about the drive without needing to recreate the drive list.
-
Constructor Details
-
AbstractHWDiskStore
-
AbstractHWDiskStore
-
-
Method Details
-
getName
Description copied from interface:HWDiskStoreThe disk name- Specified by:
getNamein interfaceHWDiskStore- Returns:
- the name
-
getModel
Description copied from interface:HWDiskStoreThe disk model- Specified by:
getModelin interfaceHWDiskStore- Returns:
- the model
-
getSerial
Description copied from interface:HWDiskStoreThe disk serial number, if available.- Specified by:
getSerialin interfaceHWDiskStore- Returns:
- the serial number
-
getSize
public long getSize()Description copied from interface:HWDiskStoreThe size of the disk- Specified by:
getSizein interfaceHWDiskStore- Returns:
- the disk size, in bytes
-
getDiskType
Description copied from interface:HWDiskStoreThe type of the disk, such as SSD, HDD, Removable, Virtual, or Unknown.- Specified by:
getDiskTypein interfaceHWDiskStore- Returns:
- the disk type string
-
getReads
public long getReads()Description copied from interface:HWDiskStoreThe number of reads from the disk- Specified by:
getReadsin interfaceHWDiskStore- Returns:
- the reads
-
getReadBytes
public long getReadBytes()Description copied from interface:HWDiskStoreThe number of bytes read from the disk- Specified by:
getReadBytesin interfaceHWDiskStore- Returns:
- the bytes read
-
getWrites
public long getWrites()Description copied from interface:HWDiskStoreThe number of writes to the disk- Specified by:
getWritesin interfaceHWDiskStore- Returns:
- the writes
-
getWriteBytes
public long getWriteBytes()Description copied from interface:HWDiskStoreThe number of bytes written to the disk- Specified by:
getWriteBytesin interfaceHWDiskStore- 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.- Specified by:
getCurrentQueueLengthin interfaceHWDiskStore- Returns:
- the current disk queue length
-
getTransferTime
public long getTransferTime()Description copied from interface:HWDiskStoreThe time spent reading or writing, in milliseconds.- Specified by:
getTransferTimein interfaceHWDiskStore- Returns:
- the transfer time
-
getTimeStamp
public long getTimeStamp()Description copied from interface:HWDiskStoreThe time this disk's statistics were updated.- Specified by:
getTimeStampin interfaceHWDiskStore- Returns:
- the timeStamp, in milliseconds since the epoch.
-
getPartitions
Description copied from interface:HWDiskStoreThe partitions on this disk.- Specified by:
getPartitionsin interfaceHWDiskStore- Returns:
- an
UnmodifiableListof the partitions on this drive.
-
setDiskStats
protected void setDiskStats(long reads, long readBytes, long writes, long writeBytes, long currentQueueLength, long transferTime, long timeStamp) Sets the disk statistics.- Parameters:
reads- number of readsreadBytes- bytes readwrites- number of writeswriteBytes- bytes writtencurrentQueueLength- current I/O queue lengthtransferTime- time spent on transfers in mstimeStamp- timestamp of the measurement
-
setReads
protected void setReads(long reads) Sets the reads.- Parameters:
reads- the reads
-
setReadBytes
protected void setReadBytes(long readBytes) Sets the read bytes.- Parameters:
readBytes- the read bytes
-
setWrites
protected void setWrites(long writes) Sets the writes.- Parameters:
writes- the writes
-
setWriteBytes
protected void setWriteBytes(long writeBytes) Sets the write bytes.- Parameters:
writeBytes- the write bytes
-
setCurrentQueueLength
protected void setCurrentQueueLength(long currentQueueLength) Sets the current queue length.- Parameters:
currentQueueLength- the queue length
-
setTransferTime
protected void setTransferTime(long transferTime) Sets the transfer time.- Parameters:
transferTime- the transfer time in ms
-
setTimeStamp
protected void setTimeStamp(long timeStamp) Sets the timestamp.- Parameters:
timeStamp- the timestamp
-
setPartitionList
Sets the partition list.- Parameters:
partitionList- the partition list
-
toString
-