Skip to content

Commit d8da724

Browse files
committed
- fix selective receive problem that was killing performance
on the riakclient_driver - update rebar to fix the annoying recompiling problem - add commented out eprof endpoints to aid in future profiling of workers
1 parent 854abc7 commit d8da724

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

rebar

28.9 KB
Binary file not shown.

src/basho_bench_app.erl

+4
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ start(_StartType, _StartArgs) ->
8888

8989

9090
stop(_State) ->
91+
%% intentionally left in to show where worker profiling start/stop calls go.
92+
%% eprof:stop_profiling(),
93+
%% eprof:analyze(total),
94+
%% eprof:log("bb.eprof"),
9195
ok.
9296

9397
%% ===================================================================

src/basho_bench_sup.erl

+4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ stop_child(Id) ->
5858
init([]) ->
5959
%% Get the number concurrent workers we're expecting and generate child
6060
%% specs for each
61+
62+
%% intentionally left in to show where worker profiling start/stop calls go.
63+
%% eprof:start(),
64+
%% eprof:start_profiling([self()]),
6165
Workers = worker_specs(basho_bench_config:get(concurrent), []),
6266
MeasurementDriver =
6367
case basho_bench_config:get(measurement_driver, undefined) of

src/basho_bench_worker.erl

+12-4
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,18 @@ worker_next_op(State) ->
279279
needs_shutdown(State) ->
280280
Parent = State#state.parent_pid,
281281
receive
282-
{'EXIT', Parent, _Reason} ->
283-
%% Give the driver a chance to cleanup
284-
(catch (State#state.driver):terminate(normal, State#state.driver_state)),
285-
true
282+
{'EXIT', Pid, _Reason} ->
283+
case Pid of
284+
Parent ->
285+
%% Give the driver a chance to cleanup
286+
(catch (State#state.driver):terminate(normal,
287+
State#state.driver_state)),
288+
true;
289+
_Else ->
290+
%% catch this so that selective recieve doesn't kill us when running
291+
%% the riakclient_driver
292+
false
293+
end
286294
after 0 ->
287295
false
288296
end.

0 commit comments

Comments
 (0)