From 20fc593ec5312acec3f0b862d7ff47757e3f1a67 Mon Sep 17 00:00:00 2001 From: David Ansari Date: Fri, 17 Jan 2025 10:28:19 +0100 Subject: [PATCH] Highlight busy incoming links Visualise busy links from publisher to RabbitMQ. If the link credit reaches 0, we set a yellow background colour in the cell. Note that these credit values can change many times per second while the management UI refreshes only every few seconds. However, it may still give a user an idea of what links are currently busy. We use yellow since that's consistent with the `flow` state in AMQP 0.9.1, which is also set to yellow. We do not want want to highlight **outgoing** links with credit 0 as that might be a paused consumer, and therefore not a busy link. We also use yellow background color if incoming-window is 0 (in case of a cluster wider memory or disk alarm) or if remote-incoming-window is 0 as consumers should try to keep their incoming-window open and instead use link credit if they want to pause consumption. Additionaly we set a grey background colour for the `/management` address just to highlight them slightly since these are "special" link pairs. --- .../rabbitmq_management/priv/www/css/main.css | 8 ++++++++ .../priv/www/js/tmpl/sessions-list.ejs | 20 ++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/deps/rabbitmq_management/priv/www/css/main.css b/deps/rabbitmq_management/priv/www/css/main.css index b3e404b794b8..d03933845bdb 100644 --- a/deps/rabbitmq_management/priv/www/css/main.css +++ b/deps/rabbitmq_management/priv/www/css/main.css @@ -420,3 +420,11 @@ input.toggle:checked + label.toggle:after { left: calc(100% - 2px); transform: translateX(-100%); } + +.grey-background { + background-color: #f0f0f0; +} + +.yellow-background { + background-color: #ffff7b; +} diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/sessions-list.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/sessions-list.ejs index 1bd9558cdac4..a495736375aa 100644 --- a/deps/rabbitmq_management/priv/www/js/tmpl/sessions-list.ejs +++ b/deps/rabbitmq_management/priv/www/js/tmpl/sessions-list.ejs @@ -1,3 +1,13 @@ +<% +function getAddressClass(address) { + return address === '/management' ? 'grey-background' : ''; +} + +function getCreditClass(credit) { + return credit === 0 || credit === '0' ? 'yellow-background' : ''; +} +%> + <% if (sessions.length > 0) { %> @@ -22,9 +32,9 @@ - + - + @@ -53,11 +63,11 @@ - + - + <% } %> @@ -91,7 +101,7 @@ - +
<%= fmt_string(session.channel_number) %> <%= fmt_string(session.handle_max) %> <%= fmt_string(session.next_incoming_id) %><%= fmt_string(session.incoming_window) %><%= fmt_string(session.incoming_window) %> <%= fmt_string(session.next_outgoing_id) %><%= fmt_string(session.remote_incoming_window) %><%= fmt_string(session.remote_incoming_window) %> <%= fmt_string(session.remote_outgoing_window) %> <%= fmt_string(session.outgoing_unsettled_deliveries) %>