Java Code Examples for oshi.hardware.HWDiskStore#getReadBytes()
The following examples show how to use
oshi.hardware.HWDiskStore#getReadBytes() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DiskStatistics.java From garmadon with Apache License 2.0 | 6 votes |
@Override protected void innerCollect(StatisticsSink sink) throws Throwable { int i = 0; for (HWDiskStore disk : disks) { String name = disk.getName().replace("/dev/", ""); disk.updateDiskStats(); sink.add(name + DISK_READS_SUFFIX, disk.getReads() - previousReads[i]); previousReads[i] = disk.getReads(); sink.add(name + DISK_READBYTES_SUFFIX, disk.getReadBytes() - previousReadBytes[i]); previousReadBytes[i] = disk.getReadBytes(); sink.add(name + DISK_WRITES_SUFFIX, disk.getWrites() - previousWrites[i]); previousWrites[i] = disk.getWrites(); sink.add(name + DISK_WRITEBYTES_SUFFIX, disk.getWriteBytes() - previousWriteBytes[i]); previousWriteBytes[i] = disk.getWriteBytes(); i++; } }
Example 2
Source File: DiskUsageSampler.java From kieker with Apache License 2.0 | 5 votes |
private DiskUsageStatistic getCurrentDiskUsageStatistic(final ITimeSource timesource, final String deviceName, final HWDiskStore hwDiskStore) { final long currentTimestamp = timesource.getTime(); final double queue = hwDiskStore.getCurrentQueueLength(); final long readBytes = hwDiskStore.getReadBytes(); final long reads = hwDiskStore.getReads(); final double serviceTime = hwDiskStore.getTimeStamp(); final long writeBytes = hwDiskStore.getWriteBytes(); final long writes = hwDiskStore.getWrites(); return new DiskUsageStatistic(currentTimestamp, queue, readBytes, reads, serviceTime, writeBytes, writes); }