Skip to content
Snippets Groups Projects
Commit 02dfc664 authored by David Bauer's avatar David Bauer
Browse files

gluon-status-page: update memory usage estimation

Let gluon-respondd expose "MemAvailable" from /proc/meminfo to allow for
a more realistic memory-usage estimation.

Information on MemAvailable can be found here:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773
parent 44c70ca4
No related branches found
No related tags found
No related merge requests found
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
return _['%s used'].sprintf(formatNumber(100 * value, 3) + '%'); return _['%s used'].sprintf(formatNumber(100 * value, 3) + '%');
}, },
'memory': function(memory) { 'memory': function(memory) {
var usage = 1 - (memory.free + memory.buffers + memory.cached) / memory.total var usage = 1 - memory.available / memory.total
return formats.percent(usage); return formats.percent(usage);
}, },
'time': function(seconds) { 'time': function(seconds) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment