Skip to content

Commit

Permalink
Patch handoff status to work with status_v2.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeiklejohn committed Aug 1, 2012
1 parent 6a1161c commit 72a0633
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/riak_control_session.erl
Expand Up @@ -269,7 +269,6 @@ get_member_info (_Member={Node,Status},Ring) ->

%% run locally per-node, collects information about this node for the session
get_my_info () ->
Handoffs=riak_core_handoff_manager:status(),
{Total,Used}=get_my_memory(),

%% construct the member information for this node
Expand All @@ -279,9 +278,22 @@ get_my_info () ->
mem_used=Used,
mem_erlang=proplists:get_value(total,erlang:memory()),
vnodes=riak_core_vnode_manager:all_vnodes(),
handoffs=[{M,I,N} || {{M,I},N,outbound,_,_} <- Handoffs]
handoffs=get_handoff_status()
}.

%% format transfer to unifed display.
format_transfer(Transfer) ->
{status_v2, Handoff} = Transfer,
Mod = proplists:get_value(mod, Handoff),
SrcPartition = proplists:get_value(src_partition, Handoff),
SrcNode = proplists:get_value(src_node, Handoff),
{Mod, SrcPartition, SrcNode}.

%% get handoffs.
get_handoff_status() ->
Transfers = riak_core_handoff_manager:status({direction, outbound}),
[format_transfer(Transfer) || Transfer <- lists:flatten(Transfers)].

%% get memory information for this machine
get_my_memory () ->
Mem=memsup:get_system_memory_data(),
Expand Down

0 comments on commit 72a0633

Please sign in to comment.