Skip to content

Commit

Permalink
avoiding badarith
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando 'Brujo' Benavides committed Nov 29, 2011
1 parent f63d768 commit 420b648
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/edis_bench.erl
Expand Up @@ -168,8 +168,13 @@ graph(Results, Options) ->
end || {K,V,M} <- Results],
Top = lists:max([erlang:max(V, M) || {_, V, M} <- Data]),
Bottom = erlang:trunc(lists:min([erlang:min(V, M) || {_, V, M} <- Data, V > 0, M > 0]) / 2),
Step = (Top - Bottom) / proplists:get_value(rows, Options, 70),
io:format("8"),
Step =
case {Top, Bottom} of
{error, _} -> throw(everything_is_an_error);
{_, error} -> throw(everything_is_an_error);
_ ->
(Top - Bottom) / proplists:get_value(rows, Options, 70)
end,
graph(Top, Bottom, Step, proplists:get_value(symbols, Options, #symbols{}), Data).

graph(Top, Bottom, _Step, _Symbols, Data) when Top =< Bottom ->
Expand Down

0 comments on commit 420b648

Please sign in to comment.