Skip to content

Commit 70d3c71

Browse files
author
Li Wen
authored
Merge pull request #43 from cloudant/fdb-acceptance-102-fix-testdurationtime
fix actual benchmark duration time is not correct issue
2 parents 0a84874 + ffeb665 commit 70d3c71

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)