diff options
author | Rob Harrop <rob@rabbitmq.com> | 2010-10-19 10:53:34 +0100 |
---|---|---|
committer | Rob Harrop <rob@rabbitmq.com> | 2010-10-19 10:53:34 +0100 |
commit | 94058959138d8643464e7a6b8d76d3e9becee64c (patch) | |
tree | 61122dd40f78b6274342c678ea415464a14d54da | |
parent | 8c21276b4c97d4be3060f2195e75d80364fa93ea (diff) | |
parent | 833d58cb7e08dd839f2f470eefea83955ca57fe6 (diff) | |
download | rabbitmq-server-94058959138d8643464e7a6b8d76d3e9becee64c.tar.gz |
merge with default
-rw-r--r-- | src/rabbit_variable_queue.erl | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/src/rabbit_variable_queue.erl b/src/rabbit_variable_queue.erl index cbc71bcc..fef44037 100644 --- a/src/rabbit_variable_queue.erl +++ b/src/rabbit_variable_queue.erl @@ -229,7 +229,6 @@ len, persistent_count, - duration_target, target_ram_msg_count, ram_msg_count, ram_msg_count_prev, @@ -315,7 +314,6 @@ persistent_count :: non_neg_integer(), transient_threshold :: non_neg_integer(), - duration_target :: number() | 'infinity', target_ram_msg_count :: non_neg_integer() | 'infinity', ram_msg_count :: non_neg_integer(), ram_msg_count_prev :: non_neg_integer(), @@ -417,7 +415,6 @@ init(QueueName, IsDurable, Recover) -> len = DeltaCount1, persistent_count = DeltaCount1, - duration_target = infinity, target_ram_msg_count = infinity, ram_msg_count = 0, ram_msg_count_prev = 0, @@ -662,8 +659,7 @@ set_ram_duration_target(DurationTarget, infinity -> infinity; _ -> trunc(DurationTarget * Rate) %% msgs = sec * msgs/sec end, - State1 = State #vqstate { target_ram_msg_count = TargetRamMsgCount1, - duration_target = DurationTarget }, + State1 = State #vqstate { target_ram_msg_count = TargetRamMsgCount1 }, a(case TargetRamMsgCount1 == infinity orelse (TargetRamMsgCount =/= infinity andalso TargetRamMsgCount1 >= TargetRamMsgCount) of @@ -678,7 +674,6 @@ ram_duration(State = #vqstate { in_counter = InCount, out_counter = OutCount, ram_msg_count = RamMsgCount, - duration_target = DurationTarget, ram_msg_count_prev = RamMsgCountPrev }) -> Now = now(), {AvgEgressRate, Egress1} = update_rate(Now, Timestamp, OutCount, Egress), @@ -691,18 +686,16 @@ ram_duration(State = #vqstate { (2 * (AvgEgressRate + AvgIngressRate)) end, - {Duration, set_ram_duration_target( - DurationTarget, - State #vqstate { - rates = Rates #rates { - egress = Egress1, - ingress = Ingress1, - avg_egress = AvgEgressRate, - avg_ingress = AvgIngressRate, - timestamp = Now }, - in_counter = 0, - out_counter = 0, - ram_msg_count_prev = RamMsgCount })}. + {Duration, State #vqstate { + rates = Rates #rates { + egress = Egress1, + ingress = Ingress1, + avg_egress = AvgEgressRate, + avg_ingress = AvgIngressRate, + timestamp = Now }, + in_counter = 0, + out_counter = 0, + ram_msg_count_prev = RamMsgCount }}. needs_idle_timeout(State = #vqstate { on_sync = ?BLANK_SYNC }) -> {Res, _State} = reduce_memory_use(fun (_Quota, State1) -> State1 end, |