Merge from default.
This commit is contained in:
commit
fcb727cba4
|
|
@ -40,6 +40,7 @@ $(CHECKOUT_DIR):
|
||||||
rm -rf $(INCLUDE_DIR)/mochiweb
|
rm -rf $(INCLUDE_DIR)/mochiweb
|
||||||
zip $(LIB_PACKAGE_NAME) $(LIB_PACKAGE_DIR)/
|
zip $(LIB_PACKAGE_NAME) $(LIB_PACKAGE_DIR)/
|
||||||
zip -r $(LIB_PACKAGE_NAME) $(LIB_PACKAGE_DIR)/$(EBIN_DIR)/
|
zip -r $(LIB_PACKAGE_NAME) $(LIB_PACKAGE_DIR)/$(EBIN_DIR)/
|
||||||
|
zip -r $(LIB_PACKAGE_NAME) $(LIB_PACKAGE_DIR)/$(INCLUDE_DIR)/
|
||||||
|
|
||||||
echo-revision:
|
echo-revision:
|
||||||
@echo $(REVISION)
|
@echo $(REVISION)
|
||||||
|
|
|
||||||
|
|
@ -92,8 +92,14 @@ function fmt_color(r, thresholds) {
|
||||||
return 'green';
|
return 'green';
|
||||||
}
|
}
|
||||||
|
|
||||||
function fmt_rate(obj, name, show_total) {
|
function fmt_rate(obj, name, show_total, cssClass) {
|
||||||
return fmt_rate0(obj, name, fmt_num, show_total);
|
var res = fmt_rate0(obj, name, fmt_num, show_total);
|
||||||
|
if (cssClass == undefined || res == '') {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return '<span class="' + cssClass + '">' + res + '</span>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function fmt_rate_bytes(obj, name) {
|
function fmt_rate_bytes(obj, name) {
|
||||||
|
|
@ -112,6 +118,24 @@ function fmt_rate0(obj, name, fmt, show_total) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function is_stat_empty(obj, name) {
|
||||||
|
if (obj == undefined
|
||||||
|
|| obj[name] == undefined
|
||||||
|
|| obj[name + '_details'] == undefined
|
||||||
|
|| obj[name + '_details'].rate < 0.00001) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function is_col_empty(channels, name) {
|
||||||
|
for (var i = 0; i < channels.length; i++) {
|
||||||
|
var channel = channels[i];
|
||||||
|
if (!is_stat_empty(channel.message_stats, name)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
function fmt_exchange(name) {
|
function fmt_exchange(name) {
|
||||||
return name == '' ? '<i>(AMQP default)</i>' : name;
|
return name == '' ? '<i>(AMQP default)</i>' : name;
|
||||||
}
|
}
|
||||||
|
|
@ -250,7 +274,9 @@ function message_rates(stats) {
|
||||||
var items = [['Publish', 'publish'], ['Confirm', 'confirm'],
|
var items = [['Publish', 'publish'], ['Confirm', 'confirm'],
|
||||||
['Deliver', 'deliver'], ['Acknowledge', 'ack'],
|
['Deliver', 'deliver'], ['Acknowledge', 'ack'],
|
||||||
['Get', 'get'], ['Deliver (noack)', 'deliver_no_ack'],
|
['Get', 'get'], ['Deliver (noack)', 'deliver_no_ack'],
|
||||||
['Get (noack)', 'get_no_ack']];
|
['Get (noack)', 'get_no_ack'],
|
||||||
|
['Return (mandatory)', 'return_unroutable'],
|
||||||
|
['Return (immediate)', 'return_not_delivered']];
|
||||||
for (var i in items) {
|
for (var i in items) {
|
||||||
var name = items[i][0];
|
var name = items[i][0];
|
||||||
var key = items[i][1] + '_details';
|
var key = items[i][1] + '_details';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,9 @@
|
||||||
<% if (channels.length > 0) { %>
|
<% if (channels.length > 0) { %>
|
||||||
|
<%
|
||||||
|
var col_return_unroutable = !is_col_empty(channels, 'return_unroutable');
|
||||||
|
var col_return_not_delivered = !is_col_empty(channels, 'return_not_delivered');
|
||||||
|
var ratesWidth = 4 + (col_return_unroutable ? 1 : 0) + (col_return_not_delivered ? 1 : 0);
|
||||||
|
%>
|
||||||
<table class="list">
|
<table class="list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -10,7 +15,7 @@
|
||||||
<th colspan="5">Details</th>
|
<th colspan="5">Details</th>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if (statistics_level == 'fine') { %>
|
<% if (statistics_level == 'fine') { %>
|
||||||
<th colspan="4">Message rates</th>
|
<th colspan="<%= ratesWidth %>">Message rates</th>
|
||||||
<% } %>
|
<% } %>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -33,6 +38,12 @@
|
||||||
<th><%= fmt_sort('confirm', 'message_stats.confirm_details.rate') %></th>
|
<th><%= fmt_sort('confirm', 'message_stats.confirm_details.rate') %></th>
|
||||||
<th><%= fmt_sort('deliver / get', 'message_stats.deliver_get_details.rate') %></th>
|
<th><%= fmt_sort('deliver / get', 'message_stats.deliver_get_details.rate') %></th>
|
||||||
<th><%= fmt_sort('ack', 'message_stats.ack_details.rate') %></th>
|
<th><%= fmt_sort('ack', 'message_stats.ack_details.rate') %></th>
|
||||||
|
<% if (col_return_unroutable) { %>
|
||||||
|
<th><%= fmt_sort('return (mandatory)', 'message_stats.return_unroutable_details.rate') %></th>
|
||||||
|
<% } %>
|
||||||
|
<% if (col_return_not_delivered) { %>
|
||||||
|
<th><%= fmt_sort('return (immediate)', 'message_stats.return_not_delivered_details.rate') %></th>
|
||||||
|
<% } %>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<!-- TODO make sortable after bug 23401 -->
|
<!-- TODO make sortable after bug 23401 -->
|
||||||
|
|
@ -47,6 +58,12 @@
|
||||||
<th>confirm</th>
|
<th>confirm</th>
|
||||||
<th>deliver / get</th>
|
<th>deliver / get</th>
|
||||||
<th>ack</th>
|
<th>ack</th>
|
||||||
|
<% if (col_return_unroutable) { %>
|
||||||
|
<th>return (mandatory)</th>
|
||||||
|
<% } %>
|
||||||
|
<% if (col_return_not_delivered) { %>
|
||||||
|
<th>return (immediate)</th>
|
||||||
|
<% } %>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% } %>
|
<% } %>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -84,6 +101,12 @@
|
||||||
<td class="r"><%= fmt_rate(channel.message_stats, 'confirm') %></td>
|
<td class="r"><%= fmt_rate(channel.message_stats, 'confirm') %></td>
|
||||||
<td class="r"><%= fmt_rate(channel.message_stats, 'deliver_get') %></td>
|
<td class="r"><%= fmt_rate(channel.message_stats, 'deliver_get') %></td>
|
||||||
<td class="r"><%= fmt_rate(channel.message_stats, 'ack') %></td>
|
<td class="r"><%= fmt_rate(channel.message_stats, 'ack') %></td>
|
||||||
|
<% if (col_return_unroutable) { %>
|
||||||
|
<td class="r"><%= fmt_rate(channel.message_stats, 'return_unroutable') %></td>
|
||||||
|
<% } %>
|
||||||
|
<% if (col_return_not_delivered) { %>
|
||||||
|
<td class="r"><%= fmt_rate(channel.message_stats, 'return_not_delivered') %></td>
|
||||||
|
<% } %>
|
||||||
<% } %>
|
<% } %>
|
||||||
</tr>
|
</tr>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@
|
||||||
|
|
||||||
<div class="section-hidden">
|
<div class="section-hidden">
|
||||||
<h2>Bindings</h2>
|
<h2>Bindings</h2>
|
||||||
<div class="hider updatable">
|
<div class="hider">
|
||||||
<% if (exchange.name == "") { %>
|
<% if (exchange.name == "") { %>
|
||||||
<h3>Default exchange</h3>
|
<h3>Default exchange</h3>
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<% if (bindings_destination.length > 0) { %>
|
<% if (bindings_destination.length > 0) { %>
|
||||||
<h3>Incoming to <b><%= fmt_exchange(exchange.name) %></b></h3>
|
<h3>Incoming to <b><%= fmt_exchange(exchange.name) %></b></h3>
|
||||||
<table class="bindings">
|
<table class="bindings updatable">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<%= format('bindings', {'mode': 'exchange_destination', 'bindings': bindings_destination}) %>
|
<%= format('bindings', {'mode': 'exchange_destination', 'bindings': bindings_destination}) %>
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
</table>
|
</table>
|
||||||
<% } %>
|
<% } %>
|
||||||
<h3>Outgoing from <b><%= fmt_exchange(exchange.name) %></b></h3>
|
<h3>Outgoing from <b><%= fmt_exchange(exchange.name) %></b></h3>
|
||||||
<table class="bindings">
|
<table class="bindings updatable">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="binding-endpoint">
|
<td class="binding-endpoint">
|
||||||
<span class="object"><%= fmt_exchange(exchange.name) %></span>
|
<span class="object"><%= fmt_exchange(exchange.name) %></span>
|
||||||
|
|
|
||||||
|
|
@ -26,8 +26,8 @@
|
||||||
<% } %>
|
<% } %>
|
||||||
<tr class="total">
|
<tr class="total">
|
||||||
<th>Total:</th>
|
<th>Total:</th>
|
||||||
<td><span class="mini-highlight"><%= fmt_rate(totals, 'deliver_get') %></span></td>
|
<td><%= fmt_rate(totals, 'deliver_get', false, 'mini-highlight') %></td>
|
||||||
<td><span class="mini-highlight"><%= fmt_rate(totals, 'ack') %></span></td>
|
<td><%= fmt_rate(totals, 'ack', false, 'mini-highlight') %></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,8 @@
|
||||||
<h3><%= label %></h3>
|
<h3><%= label %></h3>
|
||||||
|
<%
|
||||||
|
var col_return_unroutable = !is_stat_empty(totals, 'return_unroutable');
|
||||||
|
var col_return_not_delivered = !is_stat_empty(totals, 'return_not_delivered');
|
||||||
|
%>
|
||||||
<% if (object && object.length > 0) { %>
|
<% if (object && object.length > 0) { %>
|
||||||
<table class="list list-with-total">
|
<table class="list list-with-total">
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -13,6 +17,12 @@
|
||||||
<% } %>
|
<% } %>
|
||||||
<th>publish</th>
|
<th>publish</th>
|
||||||
<th>confirm</th>
|
<th>confirm</th>
|
||||||
|
<% if (col_return_unroutable) { %>
|
||||||
|
<th>return (mandatory)</th>
|
||||||
|
<% } %>
|
||||||
|
<% if (col_return_not_delivered) { %>
|
||||||
|
<th>return (immediate)</th>
|
||||||
|
<% } %>
|
||||||
</tr>
|
</tr>
|
||||||
<%
|
<%
|
||||||
for (var i = 0; i < object.length; i++) {
|
for (var i = 0; i < object.length; i++) {
|
||||||
|
|
@ -31,12 +41,24 @@
|
||||||
<% } %>
|
<% } %>
|
||||||
<td class="r"><%= fmt_rate(pub.stats, 'publish') %></td>
|
<td class="r"><%= fmt_rate(pub.stats, 'publish') %></td>
|
||||||
<td class="r"><%= fmt_rate(pub.stats, 'confirm') %></td>
|
<td class="r"><%= fmt_rate(pub.stats, 'confirm') %></td>
|
||||||
|
<% if (col_return_unroutable) { %>
|
||||||
|
<td class="r"><%= fmt_rate(pub.stats, 'return_unroutable') %></td>
|
||||||
|
<% } %>
|
||||||
|
<% if (col_return_not_delivered) { %>
|
||||||
|
<td class="r"><%= fmt_rate(pub.stats, 'return_not_delivered') %></td>
|
||||||
|
<% } %>
|
||||||
</tr>
|
</tr>
|
||||||
<% } %>
|
<% } %>
|
||||||
<tr class="total">
|
<tr class="total">
|
||||||
<th>Total:</th>
|
<th>Total:</th>
|
||||||
<td><span class="mini-highlight"><%= fmt_rate(totals, 'publish') %></span></td>
|
<td><%= fmt_rate(totals, 'publish', false, 'mini-highlight') %></td>
|
||||||
<td><span class="mini-highlight"><%= fmt_rate(totals, 'confirm') %></span></td>
|
<td><%= fmt_rate(totals, 'confirm', false, 'mini-highlight') %></td>
|
||||||
|
<% if (col_return_unroutable) { %>
|
||||||
|
<td><%= fmt_rate(totals, 'return_unroutable', false, 'mini-highlight') %></td>
|
||||||
|
<% } %>
|
||||||
|
<% if (col_return_not_delivered) { %>
|
||||||
|
<td><%= fmt_rate(totals, 'return_not_delivered', false, 'mini-highlight') %></td>
|
||||||
|
<% } %>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
|
|
|
||||||
|
|
@ -65,13 +65,13 @@
|
||||||
<%= link_node(node.name) %>
|
<%= link_node(node.name) %>
|
||||||
</td>
|
</td>
|
||||||
<% if (!node.running) { %>
|
<% if (!node.running) { %>
|
||||||
<td class="status" colspan="5">
|
<td class="status" colspan="6">
|
||||||
<div class="red">
|
<div class="red">
|
||||||
Node not running
|
Node not running
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<% } else if (node.external_stats_not_running) { %>
|
<% } else if (node.external_stats_not_running) { %>
|
||||||
<td class="status" colspan="5">
|
<td class="status" colspan="6">
|
||||||
<div class="red">
|
<div class="red">
|
||||||
Management agent not installed
|
Management agent not installed
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -105,9 +105,9 @@
|
||||||
|
|
||||||
<div class="section-hidden">
|
<div class="section-hidden">
|
||||||
<h2>Bindings</h2>
|
<h2>Bindings</h2>
|
||||||
<div class="hider updatable">
|
<div class="hider">
|
||||||
<h3>Incoming to <b><%= queue.name %></b></h3>
|
<h3>Incoming to <b><%= queue.name %></b></h3>
|
||||||
<table class="bindings">
|
<table class="bindings updatable">
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<%= format('bindings', {'mode': 'queue', 'bindings': bindings}) %>
|
<%= format('bindings', {'mode': 'queue', 'bindings': bindings}) %>
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,8 @@
|
||||||
?FINE_STATS_TYPES).
|
?FINE_STATS_TYPES).
|
||||||
|
|
||||||
-define(DELIVER_GET, [deliver, deliver_no_ack, get, get_no_ack]).
|
-define(DELIVER_GET, [deliver, deliver_no_ack, get, get_no_ack]).
|
||||||
-define(FINE_STATS, [publish, ack, deliver_get, confirm] ++ ?DELIVER_GET).
|
-define(FINE_STATS, [publish, ack, deliver_get, confirm,
|
||||||
|
return_unroutable, return_not_delivered] ++ ?DELIVER_GET).
|
||||||
|
|
||||||
-define(
|
-define(
|
||||||
FINE_STATS_CHANNEL_LIST,
|
FINE_STATS_CHANNEL_LIST,
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
-export([all_or_one_vhost/2, http_to_amqp/5, reply/3, filter_vhost/3]).
|
-export([all_or_one_vhost/2, http_to_amqp/5, reply/3, filter_vhost/3]).
|
||||||
-export([filter_user/3, with_decode/5, redirect/2, args/1]).
|
-export([filter_user/3, with_decode/5, redirect/2, args/1]).
|
||||||
-export([reply_list/3, reply_list/4, sort_list/4, destination_type/1]).
|
-export([reply_list/3, reply_list/4, sort_list/4, destination_type/1]).
|
||||||
-export([relativise/2, post_respond/1]).
|
-export([post_respond/1]).
|
||||||
|
|
||||||
-include("rabbit_mgmt.hrl").
|
-include("rabbit_mgmt.hrl").
|
||||||
-include_lib("amqp_client/include/amqp_client.hrl").
|
-include_lib("amqp_client/include/amqp_client.hrl").
|
||||||
|
|
@ -387,23 +387,6 @@ args({struct, L}) ->
|
||||||
args(L) ->
|
args(L) ->
|
||||||
rabbit_mgmt_format:to_amqp_table(L).
|
rabbit_mgmt_format:to_amqp_table(L).
|
||||||
|
|
||||||
relativise("/" ++ F, "/" ++ T) ->
|
|
||||||
From = string:tokens(F, "/"),
|
|
||||||
To = string:tokens(T, "/"),
|
|
||||||
relativise0(From, To).
|
|
||||||
|
|
||||||
relativise0([H], [H|_] = To) ->
|
|
||||||
string:join(To, "/");
|
|
||||||
relativise0([H|From], [H|To]) ->
|
|
||||||
relativise0(From, To);
|
|
||||||
relativise0(From, []) ->
|
|
||||||
relativise(From, [], 0);
|
|
||||||
relativise0(From, To) ->
|
|
||||||
relativise(From, To, 1).
|
|
||||||
|
|
||||||
relativise(From, To, Diff) ->
|
|
||||||
string:join(lists:duplicate(length(From) - Diff, "..") ++ To, "/").
|
|
||||||
|
|
||||||
%% Make replying to a post look like anything else...
|
%% Make replying to a post look like anything else...
|
||||||
post_respond({{halt, Code}, ReqData, Context}) ->
|
post_respond({{halt, Code}, ReqData, Context}) ->
|
||||||
{{halt, Code}, ReqData, Context};
|
{{halt, Code}, ReqData, Context};
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ accept_content(ReqData, {_Mode, Context}) ->
|
||||||
rabbit_mgmt_util:with_decode(
|
rabbit_mgmt_util:with_decode(
|
||||||
[routing_key, arguments], ReqData, Context,
|
[routing_key, arguments], ReqData, Context,
|
||||||
fun([Key, Args]) ->
|
fun([Key, Args]) ->
|
||||||
Loc = rabbit_mgmt_util:relativise(
|
Loc = rabbit_mochiweb_util:relativise(
|
||||||
wrq:path(ReqData),
|
wrq:path(ReqData),
|
||||||
binary_to_list(
|
binary_to_list(
|
||||||
rabbit_mgmt_format:url(
|
rabbit_mgmt_format:url(
|
||||||
|
|
|
||||||
|
|
@ -48,15 +48,6 @@ pack_binding_test() ->
|
||||||
rabbit_mgmt_format:unpack_binding_props(<<"bad_routing">>),
|
rabbit_mgmt_format:unpack_binding_props(<<"bad_routing">>),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
relativise_test() ->
|
|
||||||
"baz" = rabbit_mgmt_util:relativise("/foo/bar/bash", "/foo/bar/baz"),
|
|
||||||
"../bax/baz" = rabbit_mgmt_util:relativise("/foo/bar/bash", "/foo/bax/baz"),
|
|
||||||
"../bax/baz" = rabbit_mgmt_util:relativise("/bar/bash", "/bax/baz"),
|
|
||||||
".." = rabbit_mgmt_util:relativise("/foo/bar/bash", "/foo/bar"),
|
|
||||||
"../.." = rabbit_mgmt_util:relativise("/foo/bar/bash", "/foo"),
|
|
||||||
"bar/baz" = rabbit_mgmt_util:relativise("/foo/bar", "/foo/bar/baz"),
|
|
||||||
ok.
|
|
||||||
|
|
||||||
amqp_table_test() ->
|
amqp_table_test() ->
|
||||||
assert_table({struct, []}, []),
|
assert_table({struct, []}, []),
|
||||||
assert_table({struct, [{<<"x-expires">>, 1000}]},
|
assert_table({struct, [{<<"x-expires">>, 1000}]},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue