Skip to content

Commit

Permalink
- Add comments and fix indention
Browse files Browse the repository at this point in the history
- Update changelog

Signed-off-by: Volker Theile <votdev@gmx.de>
  • Loading branch information
votdev committed Dec 9, 2017
1 parent 538caf7 commit 2799e50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions deb/openmediavault/debian/changelog
Expand Up @@ -133,6 +133,7 @@ openmediavault (4.0) stable; urgency=low
openmediavault (3.0.95) stable; urgency=low

* Increase 'Unit' column size in file system quota dialog.
* Fix calculation of CPU utilization.

-- Volker Theile <volker.theile@openmediavault.org> Sat, 02 Dec 2017 13:55:14 +0100

Expand Down
Expand Up @@ -320,6 +320,10 @@ class System {
// * iowait: waiting for I/O to complete
// * irq: servicing interrupts
// * softirq: servicing softirqs
//
// See also
// - https://serverfault.com/a/667250.
// - https://en.wikipedia.org/wiki/Load_(computing)
$tprev = file("/proc/stat");
sleep(1);
$tnow = file("/proc/stat");
Expand Down Expand Up @@ -353,9 +357,9 @@ class System {
return [
"modelname" => $modelName,
"cpumhz" => $cpuInfo->exists("cpumhz") ?
$cpuInfo->get("cpumhz") : gettext("n/a"),
"usage" => (0 == $diffTotal) ? 0 : (($diffTotal - $diffIowait - $diffIdle) /
$diffTotal) * 100
$cpuInfo->get("cpumhz") : gettext("n/a"),
"usage" => (0 == $diffTotal) ? 0 :
(($diffTotal - $diffIowait - $diffIdle) / $diffTotal) * 100
];
}
}

0 comments on commit 2799e50

Please sign in to comment.