diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2012-10-09 13:10:47 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2012-10-09 13:10:47 +0100 |
| commit | ed73628f21e17100241f7e9a34c26cf23afb0128 (patch) | |
| tree | 1f221be79ab3f5f399a91a7c33b6c123ca6247d7 /src | |
| parent | d412d9a89e6d89323dac7d4b9aab9a1fd947334e (diff) | |
| download | rabbitmq-server-git-ed73628f21e17100241f7e9a34c26cf23afb0128.tar.gz | |
Remove rabbit_misc:interval_operation/3, it doesn't really work.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_misc.erl | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/src/rabbit_misc.erl b/src/rabbit_misc.erl index 83ac10047a..a0536a50a9 100644 --- a/src/rabbit_misc.erl +++ b/src/rabbit_misc.erl @@ -63,7 +63,6 @@ -export([version/0]). -export([sequence_error/1]). -export([json_encode/1, json_decode/1, json_to_term/1, term_to_json/1]). --export([interval_operation/3]). %% Horrible macro to use in guards -define(IS_BENIGN_EXIT(R), @@ -228,8 +227,6 @@ -spec(json_decode/1 :: (string()) -> {'ok', any()} | 'error'). -spec(json_to_term/1 :: (any()) -> any()). -spec(term_to_json/1 :: (any()) -> any()). --spec(interval_operation/3 :: - (thunk(A), float(), non_neg_integer()) -> {A, non_neg_integer()}). -endif. @@ -990,13 +987,3 @@ term_to_json(L) when is_list(L) -> term_to_json(V) when is_binary(V) orelse is_number(V) orelse V =:= null orelse V =:= true orelse V =:= false -> V. - -%% Ideally, you'd want Fun to run every IdealInterval. but you don't -%% want it to take more than MaxRatio of IdealInterval. So if it takes -%% more then you want to run it less often. So we time how long it -%% takes to run, and then suggest how long you should wait before -%% running it again. Times are in millis. -interval_operation(Fun, MaxRatio, IdealInterval) -> - {Micros, Res} = timer:tc(Fun), - Ratio = lists:max([1, Micros / (MaxRatio * IdealInterval) / 1000]), - {Res, round(IdealInterval * Ratio)}. |
