Include not named_tables on top overview

This commit is contained in:
Diana Corbacho 2018-07-11 12:01:28 +01:00
parent 8355352a3d
commit 81c9829314
3 changed files with 10 additions and 9 deletions

View File

@ -29,6 +29,7 @@
<th><%= fmt_sort_desc_by_default('Memory', 'memory') %></th>
<th><%= fmt_sort_desc_by_default('Size', 'size') %></th>
<th><%= fmt_sort_desc_by_default('Type', 'type') %></th>
<th><%= fmt_sort_desc_by_default('Named', 'named_table') %></th>
<th>Protection</th>
<th>Compressed</th>
</tr>
@ -44,6 +45,7 @@
<td><%= fmt_bytes(table.memory * 1.0) %></td>
<td><%= table.size %></td>
<td><%= table.type %></td>
<td><%= table.named_table %></td>
<td><%= table.protection %></td>
<td><%= table.compressed %></td>
</tr>

View File

@ -55,9 +55,9 @@ ets_tables(Node, Sort, Order, RowCount) ->
end.
fmt(Info) ->
{owner, Pid} = lists:keyfind(owner, 1, Info),
%% OTP 21 introduced the 'id' element that contains a reference.
%% These cannot be serialised and must be removed from the proplist
Info1 = lists:keydelete(owner, 1,
lists:keydelete(id, 1, Info)),
[{owner, rabbit_top_util:fmt(Pid)} | Info1].
{owner, OPid} = lists:keyfind(owner, 1, Info),
{heir, HPid} = lists:keyfind(heir, 1, Info),
Info1 = lists:keydelete(owner, 1, Info),
Info2 = lists:keydelete(heir, 1, Info1),
[{owner, rabbit_top_util:fmt(OPid)},
{heir, rabbit_top_util:fmt(HPid)} | Info2].

View File

@ -122,13 +122,12 @@ ets_tables(_OldTables) ->
end,
ets:all()).
table_info(Table) when not is_atom(Table) -> undefined;
table_info(TableName) when is_atom(TableName) ->
table_info(Table) ->
Info = lists:map(fun
({memory, MemWords}) -> {memory, bytes(MemWords)};
(Other) -> Other
end,
ets:info(TableName)),
ets:info(Table)),
{owner, OwnerPid} = lists:keyfind(owner, 1, Info),
case process_info(OwnerPid, registered_name) of
[] -> Info;