22
22
23
23
-define (SYNC_INTERVAL , 200 ). % % milliseconds
24
24
-define (RAM_DURATION_UPDATE_INTERVAL , 5000 ).
25
- -define (CONSUMER_BIAS_RATIO , 1.1 ). % % i.e. consume 10% faster
26
25
27
26
-export ([info_keys /0 ]).
28
27
@@ -969,26 +968,26 @@ emit_consumer_deleted(ChPid, ConsumerTag, QName) ->
969
968
970
969
% %----------------------------------------------------------------------------
971
970
972
- prioritise_call (Msg , _From , _Len , State ) ->
971
+ prioritise_call (Msg , _From , _Len , _State ) ->
973
972
case Msg of
974
973
info -> 9 ;
975
974
{info , _Items } -> 9 ;
976
975
consumers -> 9 ;
977
976
stat -> 7 ;
978
- {basic_consume , _ , _ , _ , _ , _ , _ , _ , _ , _ } -> consumer_bias ( State ) ;
979
- {basic_cancel , _ , _ , _ } -> consumer_bias ( State ) ;
977
+ {basic_consume , _ , _ , _ , _ , _ , _ , _ , _ , _ } -> 1 ;
978
+ {basic_cancel , _ , _ , _ } -> 1 ;
980
979
_ -> 0
981
980
end .
982
981
983
- prioritise_cast (Msg , _Len , State ) ->
982
+ prioritise_cast (Msg , _Len , _State ) ->
984
983
case Msg of
985
984
delete_immediately -> 8 ;
986
985
{set_ram_duration_target , _Duration } -> 8 ;
987
986
{set_maximum_since_use , _Age } -> 8 ;
988
987
{run_backing_queue , _Mod , _Fun } -> 6 ;
989
988
{ack , _AckTags , _ChPid } -> 3 ; % % [1]
990
989
{resume , _ChPid } -> 2 ;
991
- {notify_sent , _ChPid , _Credit } -> consumer_bias ( State ) ;
990
+ {notify_sent , _ChPid , _Credit } -> 1 ;
992
991
_ -> 0
993
992
end .
994
993
@@ -1001,13 +1000,6 @@ prioritise_cast(Msg, _Len, State) ->
1001
1000
% % about. Finally, we prioritise ack over resume since it should
1002
1001
% % always reduce memory use.
1003
1002
1004
- consumer_bias (# q {backing_queue = BQ , backing_queue_state = BQS }) ->
1005
- case BQ :msg_rates (BQS ) of
1006
- {0.0 , _ } -> 0 ;
1007
- {Ingress , Egress } when Egress / Ingress < ? CONSUMER_BIAS_RATIO -> 1 ;
1008
- {_ , _ } -> 0
1009
- end .
1010
-
1011
1003
prioritise_info (Msg , _Len , # q {q = # amqqueue {exclusive_owner = DownPid }}) ->
1012
1004
case Msg of
1013
1005
{'DOWN' , _ , process , DownPid , _ } -> 8 ;
0 commit comments