diff options
author | Ken Moore <moorekou@gmail.com> | 2015-10-13 14:42:28 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-10-13 14:42:28 -0400 |
commit | 5a64f089a35ed61516f760f3886571362e9e7d52 (patch) | |
tree | 7a91f5454e4ac04ce08da2055b3c3deef1fc27ab | |
parent | Finish cleaning up the new desktop icon upscaling routines so that an app ico... (diff) | |
download | lumina-5a64f089a35ed61516f760f3886571362e9e7d52.tar.gz lumina-5a64f089a35ed61516f760f3886571362e9e7d52.tar.bz2 lumina-5a64f089a35ed61516f760f3886571362e9e7d52.zip |
Update the FreeBSD device IO calculation: Now it will return the instantaneous disk IO stat instead of the system uptime average.
-rw-r--r-- | libLumina/LuminaOS-FreeBSD.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
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<info.length(); i++){ //skip the first two lines, just labels + for(int i=(info.length()/2)+2; i<info.length(); i++){ //skip the first data entry , just labels info[i].replace("\t"," "); if(i==1){ labs = info[i].split(" ", QString::SkipEmptyParts); }//the labels for each column else{ |