Scalaris Management Interface

out(Arg) -> {header, {cache_control, "no-cache"}}.

## Scalaris

Home
Ring
out(Arg) -> case whereis(mgmt_server) of undefined -> {html, ""}; _ -> {html, "
Indexed Ring
Vivaldi Map
" ++ case config:read(dc_clustering_enable) of true -> "
Datacenter Clusters Map
"; _ -> "" end ++ "
Benchmarks
"} end.
Gossip values
Client Monitor
Ring Monitor
Docu
Debug
Message Stats

## Message Statistics

make_footer(Start, TotalBytes, TotalCount) -> [{tr, [], [ {td, [], {p, [], "Total"}}, {td, [], io_lib:format("~15.10B", [TotalBytes])}, {td, [], io_lib:format("~15.10B", [TotalCount])}, {td, [], io_lib:format("~15.3f", [TotalBytes / erlang:max(1, timer:now_diff(os:timestamp(), Start)) * 1000000.0])}, {td, [], io_lib:format("~15.3f", [TotalCount / erlang:max(1, timer:now_diff(os:timestamp(), Start)) * 1000000.0])}, {td, [], io_lib:format("~15.3f", [TotalBytes / TotalCount])}, {td, [], io_lib:format("~15.3f", [100.0])}, {td, [], io_lib:format("~15.3f", [100.0])} ] } ]. make_table([], _, _, _, _) -> []; make_table([{Tag, _} | Rest], Map, Start, TotalBytes, TotalCount) -> {Size, Count} = gb_trees:get(Tag, Map), RealTag = case Tag of {Channel, MsgTag} -> {Channel, util:extint2atom(MsgTag)}; MsgTag -> util:extint2atom(MsgTag) end, [{tr, [], [ {td, [], {p, [], io_lib:format("~p", [RealTag])}}, {td, [], io_lib:format("~15.10B", [Size])}, {td, [], io_lib:format("~15.10B", [Count])}, {td, [], io_lib:format("~15.3f", [Size / erlang:max(1, timer:now_diff(os:timestamp(), Start)) * 1000000.0])}, {td, [], io_lib:format("~15.3f", [Count / erlang:max(1, timer:now_diff(os:timestamp(), Start)) * 1000000.0])}, {td, [], io_lib:format("~15.3f", [Size / Count])}, {td, [], io_lib:format("~15.3f", [Size / TotalBytes * 100.0])}, {td, [], io_lib:format("~15.3f", [Count / TotalCount * 100.0])} ] } | make_table(Rest, Map, Start, TotalBytes, TotalCount)]. get_totals(none, TotalBytes, TotalCount) -> {TotalBytes, TotalCount}; get_totals({_Tag, {Size, Count}, Iterator}, TotalBytes, TotalCount) -> get_totals(gb_trees:next(Iterator), Size + TotalBytes, Count + TotalCount). get_tags(none) -> []; get_tags({Tag, {Size, _Count}, Iterator}) -> [{Tag, Size} | get_tags(gb_trees:next(Iterator))]. tree_log_to_table(Map, Start, Heading) -> case gb_trees:size(Map) of 0 -> [{h3, [], Heading}, {p, [], "No messages logged. Enable logging in `include/scalaris.hrl` (`LOG_MESSAGE` and/or `LOG_MESSAGE_SOCK` macro)."}]; _ -> SortedTagList = lists:reverse(lists:keysort(2, get_tags(gb_trees:next(gb_trees:iterator(Map))))), {TotalBytes, TotalCount} = get_totals(gb_trees:next(gb_trees:iterator(Map)), 0, 0), TableHead = {thead, [], [{tr, [], [ {th, [], "Message Tag"}, {th, [], "Total Size"}, {th, [], "Total Count"}, {th, [], "Average Byte/s"}, {th, [], "Average 1/s"}, {th, [], "Average Msg Size"}, {th, [], "Percent of Bytes"}, {th, [], "Percent of Count"} ]} ]}, TableBody = {tbody, [], [make_table(SortedTagList, Map, Start, TotalBytes, TotalCount)]}, TableFooter = {tfoot, [], [make_footer(Start, TotalBytes, TotalCount)]}, [{h3, [], Heading}, {table, [{class, 'tablesorter'}], [TableHead, TableBody, TableFooter]}] end. out(Arg) -> {Received, Sent, Start} = comm_logger:dump(), {ehtml, [tree_log_to_table(Received, Start, "Received Messages") ++ tree_log_to_table(Sent, Start, "Sent Messages")]}.

Last update: out(Arg) -> {Date, {Hour, Minute, Second}} = calendar:local_time(), {html, io_lib:format("~2..0B:~2..0B:~2..0B", [Hour, Minute, Second])}.