Permalink
Browse files

Fix NaN memory errors.

  • Loading branch information...
1 parent 3c7bcc0 commit e900bd3c3535d1adf508d2f308a8b52a78749d78 @cmeiklejohn cmeiklejohn committed Apr 12, 2013

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -166,14 +166,14 @@ $(document).ready(function() {
// Memory usage
$(document).on('mouseover', '.membar-bg, .free-memory', function () {
var parent = $(this).parent(),
- free_mem = parent.find('.free-memory').text(),
- erlang_mem, non_erlang_mem;
+ erlang_mem, non_erlang_mem,
+ free_mem = parent.find('.unknown-mem').attr('name');
if (free_mem.charAt(0) === '?') {
displayTips('Because this node is currently unreachable or incompatible with Riak Control, Riak Control is not able to assess its memory usage.');
} else {
- free_mem = parseInt(free_mem);
- erlang_mem = parseInt(parent.find('.erlang-mem').attr('name'));
- non_erlang_mem = parseInt(parent.find('.non-erlang-mem').attr('name'));
+ free_mem = parseInt(free_mem, 10);
+ erlang_mem = parseInt(parent.find('.erlang-mem').attr('name'), 10);
+ non_erlang_mem = parseInt(parent.find('.non-erlang-mem').attr('name'), 10);
displayTips('The machine running this node currently has ' + free_mem + '% free memory. Of the ' + (erlang_mem + non_erlang_mem) + '% currently in use, ' + erlang_mem + '% is being used by Riak and ' + non_erlang_mem + '% is being used by other processes.');
}
}).on('mouseout', '.membar-bg, .free-memory', emptyTips);
@@ -24,9 +24,9 @@
{{#if reachable}}
<div class="membar-bg">
<div class="mem-colors">
- <div class="erlang-mem mem-color" {{bindAttr style="mem_erlang_style"}} name=""></div>
- <div class="non-erlang-mem mem-color" {{bindAttr style="mem_non_erlang_style"}} name=""></div>
- <div class="unknown-mem" {{bindAttr style="mem_free_style"}}></div>
+ <div class="erlang-mem mem-color" {{bindAttr style="mem_erlang_style"}} {{bindAttr name="mem_erlang_ceil"}}></div>
+ <div class="non-erlang-mem mem-color" {{bindAttr style="mem_non_erlang_style"}} {{bindAttr name="mem_non_erlang"}}></div>
+ <div class="unknown-mem" {{bindAttr style="mem_free_style"}} {{bindAttr name="mem_free_readable"}}></div>
</div>
<div class="membar-fg"></div>
</div>

0 comments on commit e900bd3

Please sign in to comment.