aboutsummaryrefslogtreecommitdiff
path: root/libLumina
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-05-22 14:22:34 -0400
committerKen Moore <ken@pcbsd.org>2015-05-22 14:22:34 -0400
commit9577036844c3450cbd0caa5aabf35ef255ff8f22 (patch)
treedd805635a8466defdb49952307c3fb9a4a728d60 /libLumina
parentFinish cleaning up the new CPU/Memory desction routines in libLumina, and add... (diff)
downloadlumina-9577036844c3450cbd0caa5aabf35ef255ff8f22.tar.gz
lumina-9577036844c3450cbd0caa5aabf35ef255ff8f22.tar.bz2
lumina-9577036844c3450cbd0caa5aabf35ef255ff8f22.zip
Commit some debug output for the new Memory/CPU calculations.
Diffstat (limited to 'libLumina')
-rw-r--r--libLumina/LuminaOS-FreeBSD.cpp6
-rw-r--r--libLumina/LuminaUtils.cpp2
2 files changed, 7 insertions, 1 deletions
diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp
index 3bf857d9..290ddc11 100644
--- a/libLumina/LuminaOS-FreeBSD.cpp
+++ b/libLumina/LuminaOS-FreeBSD.cpp
@@ -297,7 +297,11 @@ int LOS::MemoryUsagePercent(){
if(mem[i].contains("Inact") || mem[i].contains("Free")){ fB = fB+LUtils::DisplaySizeToBytes(mem[i].section(" ",0,0)); }
else{ uB = uB+LUtils::DisplaySizeToBytes(mem[i].section(" ",0,0)); }
}
- return qRound( (uB/(fB+uB)) * 100.0);
+ qDebug() << "Memory Calc:" << mem;
+ qDebug() << " - Bytes:" << "U:"<<uB<<"F:"<< fB<<"T:"<< (uB+fB);
+ double per = (uB/(fB+uB)) * 100.0;
+ qDebug() << " - Percentage:" << per;
+ return qRound(per);
}
#endif
diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp
index 8eee76ca..c9b13b8a 100644
--- a/libLumina/LuminaUtils.cpp
+++ b/libLumina/LuminaUtils.cpp
@@ -145,6 +145,7 @@ void LUtils::LoadTranslation(QApplication *app, QString appname){
}
double LUtils::DisplaySizeToBytes(QString num){
+ //qDebug() << "Convert Num to Bytes:" << num;
num = num.toLower().simplified();
num = num.remove(" ");
if(num.isEmpty()){ return 0.0; }
@@ -159,6 +160,7 @@ double LUtils::DisplaySizeToBytes(QString num){
if(lab==labs[i]){ break; }//already at the right units - break out
N = N*1024.0; //Move to the next unit of measurement
}
+ //qDebug() << " - Done:" << QString::number(N) << lab << num;
return N;
}
bgstack15