From 5a64f089a35ed61516f760f3886571362e9e7d52 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 13 Oct 2015 14:42:28 -0400 Subject: Update the FreeBSD device IO calculation: Now it will return the instantaneous disk IO stat instead of the system uptime average. --- libLumina/LuminaOS-FreeBSD.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libLumina/LuminaOS-FreeBSD.cpp') diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp index 21d0552d..b5e92e07 100644 --- a/libLumina/LuminaOS-FreeBSD.cpp +++ b/libLumina/LuminaOS-FreeBSD.cpp @@ -328,12 +328,14 @@ int LOS::MemoryUsagePercent(){ } QStringList LOS::DiskUsage(){ //Returns: List of current read/write stats for each device - QStringList info = LUtils::getCmdOutput("iostat -dx -t IDE -t SCSI -t da"); - if(info.length()<3){ return QStringList(); } //nothing from command + QStringList info = LUtils::getCmdOutput("iostat -dx -c 2 -w 0.1 -t IDE -t SCSI -t da"); + //Note: This returns the statistics *twice*: the first set is average for entire system + // - the second set is the actual average stats over that 0.1 second + if(info.length()<6){ return QStringList(); } //nothing from command QStringList labs = info[1].split(" ",QString::SkipEmptyParts); QStringList out; QString fmt = "%1: %2 %3"; - for(int i=2; i