Show mnesia table memory in bytes, not in words

This commit is contained in:
Badlop 2021-05-18 14:53:06 +02:00
parent 95fa43aa96
commit 494ba9a635
1 changed files with 4 additions and 2 deletions

View File

@ -1151,6 +1151,7 @@ get_node(global, Node, [<<"db">>], Query, Lang) ->
{T, S, M}; {T, S, M};
_ -> {unknown, 0, 0} _ -> {unknown, 0, 0}
end, end,
MemoryB = Memory*erlang:system_info(wordsize),
?XE(<<"tr">>, ?XE(<<"tr">>,
[?XE(<<"td">>, [?XE(<<"td">>,
[?AC(<<"./", STable/binary, [?AC(<<"./", STable/binary,
@ -1166,7 +1167,7 @@ get_node(global, Node, [<<"db">>], Query, Lang) ->
(pretty_string_int(Size)))]), (pretty_string_int(Size)))]),
?XAC(<<"td">>, ?XAC(<<"td">>,
[{<<"class">>, <<"alignright">>}], [{<<"class">>, <<"alignright">>}],
(pretty_string_int(Memory)))]) (pretty_string_int(MemoryB)))])
end, end,
STables), STables),
[?XC(<<"h1">>, [?XC(<<"h1">>,
@ -1750,6 +1751,7 @@ make_table_view(Node, STable, Lang) ->
{value, {storage_type, Type}} = lists:keysearch(storage_type, 1, TInfo), {value, {storage_type, Type}} = lists:keysearch(storage_type, 1, TInfo),
{value, {size, Size}} = lists:keysearch(size, 1, TInfo), {value, {size, Size}} = lists:keysearch(size, 1, TInfo),
{value, {memory, Memory}} = lists:keysearch(memory, 1, TInfo), {value, {memory, Memory}} = lists:keysearch(memory, 1, TInfo),
MemoryB = Memory*erlang:system_info(wordsize),
TableInfo = str:format("~p", [TInfo]), TableInfo = str:format("~p", [TInfo]),
[?XC(<<"h1">>, (str:translate_and_format(Lang, ?T("Database Tables at ~p"), [?XC(<<"h1">>, (str:translate_and_format(Lang, ?T("Database Tables at ~p"),
[Node]))), [Node]))),
@ -1780,7 +1782,7 @@ make_table_view(Node, STable, Lang) ->
?XE(<<"tr">>, ?XE(<<"tr">>,
[?XCT(<<"td">>, ?T("Memory")), [?XCT(<<"td">>, ?T("Memory")),
?XAC(<<"td">>, [{<<"class">>, <<"alignright">>}], ?XAC(<<"td">>, [{<<"class">>, <<"alignright">>}],
(pretty_string_int(Memory)) (pretty_string_int(MemoryB))
)]) )])
])]), ])]),
?XC(<<"pre">>, TableInfo)]. ?XC(<<"pre">>, TableInfo)].