diff options
| author | Michael Klishin <michael@clojurewerkz.org> | 2021-04-10 17:33:29 +0300 |
|---|---|---|
| committer | Michael Klishin <michael@clojurewerkz.org> | 2021-04-10 17:33:29 +0300 |
| commit | 7aa0fd6215aa0211bfe36fcb3de786f11550a7fb (patch) | |
| tree | cc7ed6b6b82c6f99dcd72aa86f159a032cf0acb7 | |
| parent | 8566524d3c48352144ee3c3395567cc17f45c5fd (diff) | |
| download | rabbitmq-server-git-7aa0fd6215aa0211bfe36fcb3de786f11550a7fb.tar.gz | |
CLI: format infinity high VM memory watermark in status
High VM memory watermark cannot actually be set to 'infinity' (and beyond :P)
but it can be returned as a fallback value. See #2733 for some additional
context.
We format 'infinity' as "100% of available memory". This seems to be
a reasonable way to do it because the status command will try to
present a final interpreted limit value.
Generally a limit of infinity won't be returned except very early in node
boot when the monitor(s) haven't yet started.
Per discussion with @evaskova.
| -rw-r--r-- | deps/rabbitmq_cli/lib/rabbitmq/cli/core/memory.ex | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/deps/rabbitmq_cli/lib/rabbitmq/cli/core/memory.ex b/deps/rabbitmq_cli/lib/rabbitmq/cli/core/memory.ex index 22fc5c1193..d388cf1ec8 100644 --- a/deps/rabbitmq_cli/lib/rabbitmq/cli/core/memory.ex +++ b/deps/rabbitmq_cli/lib/rabbitmq/cli/core/memory.ex @@ -59,6 +59,9 @@ defmodule RabbitMQ.CLI.Core.Memory do def formatted_watermark({:relative, val}) when is_float(val) do %{relative: val} end + def formatted_watermark(:infinity) do + %{relative: 1.0} + end def formatted_watermark({:absolute, val}) do %{absolute: parse_watermark(val)} end |
