diff options
| author | Matthew Sackman <matthew@lshift.net> | 2009-11-26 13:20:59 +0000 |
|---|---|---|
| committer | Matthew Sackman <matthew@lshift.net> | 2009-11-26 13:20:59 +0000 |
| commit | 0ca125b08addaa6a775b430ca4e18829e9385737 (patch) | |
| tree | 467671ee144e61c20f4af043f196732bee7ac9c4 | |
| parent | b1d4166c64d05e898a0091a8258fc5b878f9a0cf (diff) | |
| download | rabbitmq-server-git-0ca125b08addaa6a775b430ca4e18829e9385737.tar.gz | |
beautifuler
| -rw-r--r-- | src/rabbit_memory_monitor.erl | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/rabbit_memory_monitor.erl b/src/rabbit_memory_monitor.erl index 2fc983b4f4..f2d1e9ca75 100644 --- a/src/rabbit_memory_monitor.erl +++ b/src/rabbit_memory_monitor.erl @@ -242,7 +242,7 @@ internal_update(State = #state{memory_limit = Limit, queue_duration_count = Count}) -> MemoryRatio = erlang:memory(total) / Limit, DesiredDurationAvg1 = - case MemoryRatio < ?LIMIT_THRESHOLD of + case MemoryRatio < ?LIMIT_THRESHOLD orelse Count == 0 of true -> infinity; false -> @@ -250,10 +250,7 @@ internal_update(State = #state{memory_limit = Limit, true -> Sum + ?SUM_INC_AMOUNT; false -> Sum end, - case Count == 0 of - true -> infinity; - false -> (Sum1 / Count) / MemoryRatio - end + (Sum1 / Count) / MemoryRatio end, State1 = State#state{desired_duration = DesiredDurationAvg1}, |
