Get conn
{ok, Pid} = riakc_pb_socket:start_link("127.0.0.1", 8081).
Set variables
Bucket = <<"spam">>.
Query = <<"Scott">>.
Phases = [ {reduce,{modfun, riak_kv_mapreduce, reduce_identity},[{reduce_phase_only_1, true}],true} ].
Get the pid of the PB Server.
ServerPid = element(2,hd(supervisor:which_children(riak_kv_pb_socket_sup))).
Jot down the value of Pid
and ServerPid
on a piece of paper. Invoke frpof and send results to pb.analysis
fprof:apply(riakc_pb_socket, mapred, [Pid, Input, Phases], [{procs, [Pid, ServerPid]}]).
fprof:profile().
fprof:analyse([{dest, "pb.analysis"}]).
Open pb.analysis
with favorite editor. Refer to your Pid
& ServerPid
values to determine where time is being spent.