Skip to content

Commit ffeb665

Browse files
author
wenwl
committed
fix actual benchmark duration time is not correct issue
1 parent 0a84874 commit ffeb665

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/basho_bench_duration.erl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ handle_call(remaining, _From, State) ->
7272
handle_cast({worker_stopping, WorkerPid}, State) ->
7373
case basho_bench_worker_sup:active_workers() -- [WorkerPid] of
7474
[] ->
75-
?INFO("The application has stopped early!", []),
76-
{stop, {shutdown, normal}, State};
75+
?INFO("The application has stopped early!", []),
76+
#state{start=Start} = State,
77+
Elapsed = timer:now_diff(os:timestamp(), Start) / 60000000,
78+
{stop, {shutdown, normal}, State#state{duration=Elapsed}};
7779
_ ->
7880
maybe_end({noreply, State})
7981
end;

0 commit comments

Comments
 (0)