Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: basho/riak_core
base: feuerlabs-stat-combo
...
head fork: basho/riak_core
compare: jfw-handoff_benchmark
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
Showing with 30 additions and 8 deletions.
  1. +1 −1  src/riak_core_app.erl
  2. +29 −7 src/riak_core_handoff_sender.erl
2  src/riak_core_app.erl
View
@@ -78,7 +78,7 @@ start(_StartType, _StartArgs) ->
riak_core:register(riak_core, [{stat_mod, riak_core_stat}]),
ok = riak_core_ring_events:add_guarded_handler(riak_core_ring_handler, []),
- %% Register capabilities
+ %% Register capabilities (note: first setting in capability list is default ):
riak_core_capability:register({riak_core, vnode_routing},
[proxy, legacy],
legacy,
36 src/riak_core_handoff_sender.erl
View
@@ -52,7 +52,8 @@
src_target :: {non_neg_integer(), non_neg_integer()},
stats :: #ho_stats{},
tcp_mod :: module(),
- total :: non_neg_integer()
+ total :: non_neg_integer(),
+ total_bytes :: non_neg_integer()
}).
%%%===================================================================
@@ -144,9 +145,10 @@ start_fold(TargetNode, Module, {Type, Opts}, ParentPid, SslOpts) ->
parent=ParentPid,
socket=Socket,
src_target={SrcPartition, TargetPartition},
- stats=Stats,
+ stats=Stats, %% JFW: has objects and bytes
tcp_mod=TcpMod,
- total=0}},
+ total_bytes=0,
+ total=0}}, %% JFW: total objects
%% IFF the vnode is using an async worker to perform the fold
@@ -154,9 +156,26 @@ start_fold(TargetNode, Module, {Type, Opts}, ParentPid, SslOpts) ->
%% otherwise it will wait forever but vnode crash will be
%% caught by handoff manager. I know, this is confusing, a
%% new handoff system will be written soon enough.
- R = riak_core_vnode_master:sync_command({SrcPartition, SrcNode},
+
+%% JFW: We've added timing to this:
+{ElapsedTime, R} = timer:tc(fun () ->
+ riak_core_vnode_master:sync_command({SrcPartition, SrcNode},
Req,
- VMaster, infinity),
+ VMaster, infinity)
+end),
+
+%%
+%% R = riak_core_vnode_master:sync_command({SrcPartition, SrcNode},
+%% Req,
+%% VMaster, infinity),
+
+Bytes = R#ho_acc.total_bytes,
+Objs = R#ho_acc.total,
+ElapsedSeconds = ElapsedTime/1000000,
+Throughput = Bytes / ElapsedSeconds,
+lager:info("JFW: stats output after ~p seconds (~pms): ~p bytes in ~p objects; throughput: ~p bytes/second ~n", [ElapsedSeconds, ElapsedTime, Bytes, Objs, Throughput]),
+
+
if R == {error, vnode_shutdown} ->
?log_info("because the local vnode was shutdown", []),
throw({be_quiet, error, local_vnode_shutdown_requested});
@@ -267,12 +286,14 @@ visit_item(K, V, Acc) ->
src_target={SrcPartition, TargetPartition},
stats=Stats,
tcp_mod=TcpMod,
- total=Total
+ total=Total,
+ total_bytes=TotalBytes
} = Acc,
case Filter(K) of
true ->
BinObj = Module:encode_handoff_item(K, V),
+
M = <<?PT_MSG_OBJ:8,BinObj/binary>>,
NumBytes = byte_size(M),
@@ -281,7 +302,8 @@ visit_item(K, V, Acc) ->
case TcpMod:send(Sock, M) of
ok ->
- Acc#ho_acc{ack=Ack+1, error=ok, stats=Stats3, total=Total+1};
+ Acc#ho_acc{ack=Ack+1, error=ok, stats=Stats3, total=Total+1,
+ total_bytes=TotalBytes+NumBytes};
{error, Reason} ->
Acc#ho_acc{error={error, Reason}, stats=Stats3}
end;

No commit comments for this range

Something went wrong with that request. Please try again.