From a38b9324ef5f6c4b6b5536d10917cc0acea33f04 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Wed, 24 Apr 2019 01:26:46 +0300 Subject: [PATCH 1/2] Fold stats documentation into the main HTTP API doc guide References #696. --- .../priv/www/api/index.html | 942 ++++++++++++++++- .../priv/www/doc/stats.html | 959 ------------------ .../src/rabbit_mgmt_dispatcher.erl | 14 +- 3 files changed, 946 insertions(+), 969 deletions(-) delete mode 100644 deps/rabbitmq_management/priv/www/doc/stats.html diff --git a/deps/rabbitmq_management/priv/www/api/index.html b/deps/rabbitmq_management/priv/www/api/index.html index 8428c9ca31..5501c95851 100644 --- a/deps/rabbitmq_management/priv/www/api/index.html +++ b/deps/rabbitmq_management/priv/www/api/index.html @@ -57,8 +57,7 @@ list of subfields separated by dots. See the example below.

Most of the GET queries return many fields per - object. See the separate stats - documentation.

+ object. The second part of this guide covers those.

Examples

@@ -726,7 +725,7 @@ or: password_hash must be generated using the algorithm described here. You may also specify the hash function being used by adding the hashing_algorithm - key to the body. Currently recognised algorithms are rabbit_password_hashing_sha256, + key to the body. Currently recognised algorithms are rabbit_password_hashing_sha256, rabbit_password_hashing_sha512, and rabbit_password_hashing_md5. @@ -977,5 +976,942 @@ or: + + +

HTTP API Stats

+

+ Most of the GET requests you can issue to the HTTP API return + JSON objects with a large number of keys. While a few of these + keys represent things you set yourself in a PUT request or AMQP + command (e.g. queue durability or arguments), most of them + represent statistics to do with the object in question. This + page attempts to document them. +

+ +

+ It should be read in conjunction with the manual page + for rabbitmqctl (see your installation if on Unix / Linux, + or the + RabbitMQ website for the latest version). Any field which can + be returned by a command of the form rabbitmqctl + list_something will also be returned in the + equivalent part of the HTTP API, so all those keys are not + documented here. However, the HTTP API also adds a lot of extra + fields which are not available in rabbitmqctl. +

+ +

_details objects

+

+ Many fields represent a count of some kind: queue length, + messages acknowledged, bytes received and so on. Such absolute + counts returned by the HTTP API will often have a + corresponding _details object which offers + information on how this count has changed. So for example, from + a queue: +

+
    "messages": 123619,
+    "messages_details": {
+      "avg": 41206.333333333336,
+      "avg_rate": 1030.1583333333333,
+      "rate": 24723.8,
+      "samples": [
+        {
+          "sample": 123619,
+          "timestamp": 1400680560000
+        },
+        {
+          "sample": 0,
+          "timestamp": 1400680500000
+        },
+        {
+          "sample": 0,
+          "timestamp": 1400680440000
+        }
+      ]
+    }
+ +

+ Here we have a messages count (the total messages + in the queue), with some additional data: +

+ + + + + + + + + + + + + + + + + + +
avg + The average value for the requested time period (see below). +
avg_rate + The average rate for the requested time period. +
rate + How much the count has changed per second in the most recent + sampling interval. +
samples + Snapshots showing how the value has changed over the + requested time period. +
+ +

+ avg, avg_rate and samples + will only appear if you request a specific time period by + appending query parameters to the URL. To do this you need to + set an age and an increment for the samples you want. The end of + the range returned will always correspond to the present. +

+ +

+ Different types of data take different query parameters to + return samples, as in the following table. You can specify more + than one set of parameters if the resource you are requesting + can generate more than one type of sample (for example, queues + can return message rates and queue lengths). +

+ + + + + + + + + + + + + + + + + + +
Messages sent and receivedmsg_rates_age / msg_rates_incr
Bytes sent and receiveddata_rates_age / data_rates_incr +
Queue lengthslengths_age / lengths_incr
Node statistics (e.g. file descriptors, disk space free)node_stats_age / node_stats_incr
+ +

+ For example, + appending ?lengths_age=3600&lengths_incr=60 will + return the last hour's data on queue lengths, with a sample for + every minute. +

+ +

message_stats objects

+

+ Many objects (including queues, exchanges and channels) will + return counts of messages passing through them. These are + included in a message_stats object (which in turn + will contain _details objects for each count, as + described above). +

+

+ These can contain: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
publish + Count of messages published. +
publish_in + Count of messages published "in" to an exchange, i.e. not + taking account of routing. +
publish_out + Count of messages published "out" of an exchange, + i.e. taking account of routing. +
confirm + Count of messages confirmed. +
deliver + Count of messages delivered in acknowledgement mode to consumers. +
deliver_no_ack + Count of messages delivered in no-acknowledgement mode to consumers. +
get + Count of messages delivered in acknowledgement mode in + response to basic.get. +
get_no_ack + Count of messages delivered in no-acknowledgement mode in + response to basic.get. +
deliver_get + Sum of all four of the above. +
redeliver + Count of subset of messages in deliver_get + which had the redelivered flag set. +
return_unroutable + Count of messages returned to publisher as unroutable. +
+ +

+ Only fields for which some activity has taken place will appear. +

+ +

Detailed message stats objects

+

+ In addition, queues, exchanges and channels can return a + breakdown of message stats for each of their neighbours + (i.e. adjacent objects in the chain: channel -> exchange -> + queue -> channel). This will only happen if + the rates_mode configuration item has been switched + to detailed from its default of basic. +

+

+ As this possibly constitutes a large quantity of data, it is also + only returned when querying a single channel, queue or exchange + rather than a list. Note also that the default sample retention + policy means that these detailed message stats do not retain + historical data for more than a few seconds. +

+

+ The detailed message stats objects have different names + depending on where they are (documented below). Each set of + detailed stats consists of a list of objects with two fields, + one identifying the partner object and one stats + which is a message_stats object as described above. +

+

+ For example, from a queue: +

+
  "incoming": [
+    {
+      "stats": {
+        "publish": 352593,
+        "publish_details": {
+          "rate": 100.2
+        }
+      },
+      "exchange": {
+        "name": "my-exchange",
+        "vhost": "/"
+      }
+    }
+    {
+      "stats": {
+        "publish": 543784,
+        "publish_details": {
+          "rate": 54.6
+        }
+      },
+      "exchange": {
+        "name": "amq.topic",
+        "vhost": "/"
+      }
+    }
+  ],
+ +

+ This queue is currently receiving messages from two exchanges: + 100.2 msg/s from "my-exchange" and 54.6 msg/s from "amq.topic". +

+ +

/api/overview

+ +

+ This has the following fields: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
cluster_name + The name of the entire cluster, as set with rabbitmqctl + set_cluster_name. +
contexts + A list of web application contexts in the cluster. +
erlang_full_version + A string with extended detail about the Erlang VM and how it + was compiled, for the node connected to. +
erlang_version + A string with the Erlang version of the node connected + to. As clusters should all run the same version this can be + taken as representing the cluster. +
exchange_types + A list of all exchange types available. +
listeners + All (non-HTTP) network listeners for all nodes in the + cluster. (See contexts + in /api/nodes for HTTP). +
management_version + Version of the management plugin in use. +
message_stats + A message_stats object for everything the user can see - for + all vhosts regardless of permissions in the case + of monitoring and administrator + users, and for all vhosts the user has access to for other + users. +
node + The name of the cluster node this management plugin instance + is running on. +
object_totals + An object containing global counts of all connections, + channels, exchanges, queues and consumers, subject to the + same visibility rules as for message_stats. +
queue_totals + An object containing sums of + the messages, messages_ready + and messages_unacknowledged fields for all + queues, again subject to the same visibility rules as + for message_stats. +
rabbitmq_version + Version of RabbitMQ on the node which processed this request. +
rates_mode + 'none', 'basic' or 'detailed'. +
statistics_db_event_queue + Number of outstanding statistics events yet to be processed + by the database. +
statistics_db_node + Name of the cluster node hosting the management statistics database. +
+ +

/api/nodes

+ +

+ This has the following fields: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
applications + List of all Erlang applications running on the node. +
auth_mechanisms + List of all SASL authentication mechanisms installed on the node. +
cluster_links + A list of the other nodes in the cluster. For each node, + there are details of the TCP connection used to connect to + it and statistics on data that has been transferred. +
config_files + List of config files read by the node. +
contexts + List of all HTTP listeners on the node. +
db_dir + Location of the persistent storage used by the node. +
disk_free + Disk free space in bytes. +
disk_free_alarm + Whether the disk alarm has gone off. +
disk_free_limit + Point at which the disk alarm will go off. +
enabled_plugins + List of plugins which are both explicitly enabled and running. +
exchange_types + Exchange types available on the node. +
fd_total + File descriptors available. +
fd_used + Used file descriptors. +
io_read_avg_time + Average wall time (milliseconds) for each disk read operation in + the last statistics interval. +
io_read_bytes + Total number of bytes read from disk by the persister. +
io_read_count + Total number of read operations by the persister. +
io_reopen_count + Total number of times the persister has needed to recycle + file handles between queues. In an ideal world this number + will be zero; if the number is large, performance might be + improved by increasing the number of file handles available + to RabbitMQ. +
io_seek_avg_time + Average wall time (milliseconds) for each seek operation in + the last statistics interval. +
io_seek_count + Total number of seek operations by the persister. +
io_sync_avg_time + Average wall time (milliseconds) for each fsync() operation in + the last statistics interval. +
io_sync_count + Total number of fsync() operations by the persister. +
io_write_avg_time + Average wall time (milliseconds) for each disk write operation in + the last statistics interval. +
io_write_bytes + Total number of bytes written to disk by the persister. +
io_write_count + Total number of write operations by the persister. +
log_files + List of log files used by the node. If the node also sends + messages to stdout, "<stdout>" is also + reported in the list. +
mem_used + Memory used in bytes. +
mem_alarm + Whether the memory alarm has gone off. +
mem_limit + Point at which the memory alarm will go off. +
mnesia_disk_tx_count + Number of Mnesia transactions which have been performed that + required writes to disk. (e.g. creating a durable + queue). Only transactions which originated on this node are + included. +
mnesia_ram_tx_count + Number of Mnesia transactions which have been performed that + did not require writes to disk. (e.g. creating a transient + queue). Only transactions which originated on this node are + included. +
msg_store_read_count + Number of messages which have been read from the message store. +
msg_store_write_count + Number of messages which have been written to the message store. +
name + Node name. +
net_ticktime + Current kernel net_ticktime setting for the node. +
os_pid + Process identifier for the Operating System under which this + node is running. +
partitions + List of network partitions this node is seeing. +
proc_total + Maximum number of Erlang processes. +
proc_used + Number of Erlang processes in use. +
processors + Number of cores detected and usable by Erlang. +
queue_index_journal_write_count + Number of records written to the queue index journal. Each + record represents a message being published to a queue, + being delivered from a queue, and being acknowledged in a + queue. +
queue_index_read_count + Number of records read from the queue index. +
queue_index_write_count + Number of records written to the queue index. +
rates_mode + 'none', 'basic' or 'detailed'. +
run_queue + Average number of Erlang processes waiting to run. +
running + Boolean for whether this node is up. Obviously if this is + false, most other stats will be missing. +
sasl_log_file + Location of sasl log file. +
sockets_total + File descriptors available for use as sockets. +
sockets_used + File descriptors used as sockets. +
type + 'disc' or 'ram'. +
uptime + Time since the Erlang VM started, in milliseconds. +
+ +

/api/nodes/(name)

+ +

+ All of the above, plus: +

+ + + + + + + + + + +
memory + Detailed memory use statistics. Only appears + if ?memory=true is appended to the URL. +
binary + Detailed breakdown of the owners of binary memory. Only + appears if ?binary=true is appended to the + URL. Note that this can be an expensive query if there are + many small binaries in the system. +
+ +

/api/connections

+

/api/connections/(name)

+ +

+ See documentation for rabbitmqctl + list_connections. No additional fields, + although pid is replaced by node. +

+ +

+ Note also that while non-AMQP connections will appear in this + list (unlike rabbitmqctl list_connections), they + will omit many of the connection-level statistics. +

+ +

/api/connections/(name)/channels

+

/api/channels

+ +

+ See documentation for rabbitmqctl list_channels, + with pid replaced by node, plus: +

+ + + + + + + + + + +
connection_details + Some basic details about the owning connection. +
message_stats + See the section on message_stats above. +
+ +

/api/channels/(name)

+ +

+ All the above, plus +

+ + + + + + + + + + + + + + +
publishes + Detailed message stats (see section above) for publishes to + exchanges. +
deliveries + Detailed message stats for deliveries from queues. +
consumer_details + List of consumers on this channel, with some details on each. +
+ +

/api/exchanges

+

/api/exchanges/(vhost)

+ +

+ See documentation for rabbitmqctl list_exchanges, plus: +

+ + + + + + +
message_stats + See the section on message_stats above. +
+ +

/api/exchanges/(vhost)/(name)

+ +

+ All the above, plus: +

+ + + + + + + + + + +
incoming + Detailed message stats (see section above) for publishes + from channels into this exchange. +
outgoing + Detailed message stats for publishes from this exchange into + queues. +
+ +

/api/queues

+

/api/queues/(vhost)

+ +

+ See documentation for rabbitmqctl list_queues, with + all references to pids replaced by nodes + plus: +

+ + + + + + +
message_stats + See the section on message_stats above. +
+ +

/api/queues/(vhost)/(name)

+ +

+ All the above, plus: +

+ + + + + + + + + + + + + + +
incoming + Detailed message stats (see section above) for + publishes from exchanges into this queue. +
deliveries + Detailed message stats for deliveries from this queue into + channels. +
consumer_details + List of consumers on this channel, with some details on each. +
+ +

/api/vhosts/

+

/api/vhosts/(name)

+ +

+ All the fields from rabbitmqctl list_vhosts + (i.e. name and tracing) plus: +

+ + + + + + + + + + + + + + +
message_stats + Global message_stats for this vhost. Note that activity for + other users in this vhost is shown, even for users + without the monitoring tag. +
messages messages_ready messages_acknowledged + Sum of these fields for all queues in the vhost. +
recv_oct send_oct + Sum of these fields for all connections to the vhost. +
diff --git a/deps/rabbitmq_management/priv/www/doc/stats.html b/deps/rabbitmq_management/priv/www/doc/stats.html deleted file mode 100644 index e973b9f50c..0000000000 --- a/deps/rabbitmq_management/priv/www/doc/stats.html +++ /dev/null @@ -1,959 +0,0 @@ - - - - - - RabbitMQ Management HTTP Stats - - - -

RabbitMQ Management HTTP Stats

-

Introduction

-

- Most of the GET requests you can issue to the HTTP API return - JSON objects with a large number of keys. While a few of these - keys represent things you set yourself in a PUT request or AMQP - command (e.g. queue durability or arguments), most of them - represent statistics to do with the object in question. This - page attempts to document them. -

- -

- It should be read in conjunction with the manual page - for rabbitmqctl (see your installation if on Unix / Linux, - or the - RabbitMQ website for the latest version). Any field which can - be returned by a command of the form rabbitmqctl - list_something will also be returned in the - equivalent part of the HTTP API, so all those keys are not - documented here. However, the HTTP API also adds a lot of extra - fields which are not available in rabbitmqctl. -

- -

_details objects

-

- Many fields represent a count of some kind: queue length, - messages acknowledged, bytes received and so on. Such absolute - counts returned by the HTTP API will often have a - corresponding _details object which offers - information on how this count has changed. So for example, from - a queue: -

-
    "messages": 123619,
-    "messages_details": {
-      "avg": 41206.333333333336,
-      "avg_rate": 1030.1583333333333,
-      "rate": 24723.8,
-      "samples": [
-        {
-          "sample": 123619,
-          "timestamp": 1400680560000
-        },
-        {
-          "sample": 0,
-          "timestamp": 1400680500000
-        },
-        {
-          "sample": 0,
-          "timestamp": 1400680440000
-        }
-      ]
-    }
- -

- Here we have a messages count (the total messages - in the queue), with some additional data: -

- - - - - - - - - - - - - - - - - - -
avg - The average value for the requested time period (see below). -
avg_rate - The average rate for the requested time period. -
rate - How much the count has changed per second in the most recent - sampling interval. -
samples - Snapshots showing how the value has changed over the - requested time period. -
- -

- avg, avg_rate and samples - will only appear if you request a specific time period by - appending query parameters to the URL. To do this you need to - set an age and an increment for the samples you want. The end of - the range returned will always correspond to the present. -

- -

- Different types of data take different query parameters to - return samples, as in the following table. You can specify more - than one set of parameters if the resource you are requesting - can generate more than one type of sample (for example, queues - can return message rates and queue lengths). -

- - - - - - - - - - - - - - - - - - -
Messages sent and receivedmsg_rates_age / msg_rates_incr
Bytes sent and receiveddata_rates_age / data_rates_incr -
Queue lengthslengths_age / lengths_incr
Node statistics (e.g. file descriptors, disk space free)node_stats_age / node_stats_incr
- -

- For example, - appending ?lengths_age=3600&lengths_incr=60 will - return the last hour's data on queue lengths, with a sample for - every minute. -

- -

message_stats objects

-

- Many objects (including queues, exchanges and channels) will - return counts of messages passing through them. These are - included in a message_stats object (which in turn - will contain _details objects for each count, as - described above). -

-

- These can contain: -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
publish - Count of messages published. -
publish_in - Count of messages published "in" to an exchange, i.e. not - taking account of routing. -
publish_out - Count of messages published "out" of an exchange, - i.e. taking account of routing. -
confirm - Count of messages confirmed. -
deliver - Count of messages delivered in acknowledgement mode to consumers. -
deliver_no_ack - Count of messages delivered in no-acknowledgement mode to consumers. -
get - Count of messages delivered in acknowledgement mode in - response to basic.get. -
get_no_ack - Count of messages delivered in no-acknowledgement mode in - response to basic.get. -
deliver_get - Sum of all four of the above. -
redeliver - Count of subset of messages in deliver_get - which had the redelivered flag set. -
return_unroutable - Count of messages returned to publisher as unroutable. -
- -

- Only fields for which some activity has taken place will appear. -

- -

Detailed message stats objects

-

- In addition, queues, exchanges and channels can return a - breakdown of message stats for each of their neighbours - (i.e. adjacent objects in the chain: channel -> exchange -> - queue -> channel). This will only happen if - the rates_mode configuration item has been switched - to detailed from its default of basic. -

-

- As this possibly constitutes a large quantity of data, it is also - only returned when querying a single channel, queue or exchange - rather than a list. Note also that the default sample retention - policy means that these detailed message stats do not retain - historical data for more than a few seconds. -

-

- The detailed message stats objects have different names - depending on where they are (documented below). Each set of - detailed stats consists of a list of objects with two fields, - one identifying the partner object and one stats - which is a message_stats object as described above. -

-

- For example, from a queue: -

-
  "incoming": [
-    {
-      "stats": {
-        "publish": 352593,
-        "publish_details": {
-          "rate": 100.2
-        }
-      },
-      "exchange": {
-        "name": "my-exchange",
-        "vhost": "/"
-      }
-    }
-    {
-      "stats": {
-        "publish": 543784,
-        "publish_details": {
-          "rate": 54.6
-        }
-      },
-      "exchange": {
-        "name": "amq.topic",
-        "vhost": "/"
-      }
-    }
-  ],
- -

- This queue is currently receiving messages from two exchanges: - 100.2 msg/s from "my-exchange" and 54.6 msg/s from "amq.topic". -

- -

/api/overview

- -

- This has the following fields: -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
cluster_name - The name of the entire cluster, as set with rabbitmqctl - set_cluster_name. -
contexts - A list of web application contexts in the cluster. -
erlang_full_version - A string with extended detail about the Erlang VM and how it - was compiled, for the node connected to. -
erlang_version - A string with the Erlang version of the node connected - to. As clusters should all run the same version this can be - taken as representing the cluster. -
exchange_types - A list of all exchange types available. -
listeners - All (non-HTTP) network listeners for all nodes in the - cluster. (See contexts - in /api/nodes for HTTP). -
management_version - Version of the management plugin in use. -
message_stats - A message_stats object for everything the user can see - for - all vhosts regardless of permissions in the case - of monitoring and administrator - users, and for all vhosts the user has access to for other - users. -
node - The name of the cluster node this management plugin instance - is running on. -
object_totals - An object containing global counts of all connections, - channels, exchanges, queues and consumers, subject to the - same visibility rules as for message_stats. -
queue_totals - An object containing sums of - the messages, messages_ready - and messages_unacknowledged fields for all - queues, again subject to the same visibility rules as - for message_stats. -
rabbitmq_version - Version of RabbitMQ on the node which processed this request. -
rates_mode - 'none', 'basic' or 'detailed'. -
statistics_db_event_queue - Number of outstanding statistics events yet to be processed - by the database. -
statistics_db_node - Name of the cluster node hosting the management statistics database. -
- -

/api/nodes

- -

- This has the following fields: -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
applications - List of all Erlang applications running on the node. -
auth_mechanisms - List of all SASL authentication mechanisms installed on the node. -
cluster_links - A list of the other nodes in the cluster. For each node, - there are details of the TCP connection used to connect to - it and statistics on data that has been transferred. -
config_files - List of config files read by the node. -
contexts - List of all HTTP listeners on the node. -
db_dir - Location of the persistent storage used by the node. -
disk_free - Disk free space in bytes. -
disk_free_alarm - Whether the disk alarm has gone off. -
disk_free_limit - Point at which the disk alarm will go off. -
enabled_plugins - List of plugins which are both explicitly enabled and running. -
exchange_types - Exchange types available on the node. -
fd_total - File descriptors available. -
fd_used - Used file descriptors. -
io_read_avg_time - Average wall time (milliseconds) for each disk read operation in - the last statistics interval. -
io_read_bytes - Total number of bytes read from disk by the persister. -
io_read_count - Total number of read operations by the persister. -
io_reopen_count - Total number of times the persister has needed to recycle - file handles between queues. In an ideal world this number - will be zero; if the number is large, performance might be - improved by increasing the number of file handles available - to RabbitMQ. -
io_seek_avg_time - Average wall time (milliseconds) for each seek operation in - the last statistics interval. -
io_seek_count - Total number of seek operations by the persister. -
io_sync_avg_time - Average wall time (milliseconds) for each fsync() operation in - the last statistics interval. -
io_sync_count - Total number of fsync() operations by the persister. -
io_write_avg_time - Average wall time (milliseconds) for each disk write operation in - the last statistics interval. -
io_write_bytes - Total number of bytes written to disk by the persister. -
io_write_count - Total number of write operations by the persister. -
log_files - List of log files used by the node. If the node also sends - messages to stdout, "<stdout>" is also - reported in the list. -
mem_used - Memory used in bytes. -
mem_alarm - Whether the memory alarm has gone off. -
mem_limit - Point at which the memory alarm will go off. -
mnesia_disk_tx_count - Number of Mnesia transactions which have been performed that - required writes to disk. (e.g. creating a durable - queue). Only transactions which originated on this node are - included. -
mnesia_ram_tx_count - Number of Mnesia transactions which have been performed that - did not require writes to disk. (e.g. creating a transient - queue). Only transactions which originated on this node are - included. -
msg_store_read_count - Number of messages which have been read from the message store. -
msg_store_write_count - Number of messages which have been written to the message store. -
name - Node name. -
net_ticktime - Current kernel net_ticktime setting for the node. -
os_pid - Process identifier for the Operating System under which this - node is running. -
partitions - List of network partitions this node is seeing. -
proc_total - Maximum number of Erlang processes. -
proc_used - Number of Erlang processes in use. -
processors - Number of cores detected and usable by Erlang. -
queue_index_journal_write_count - Number of records written to the queue index journal. Each - record represents a message being published to a queue, - being delivered from a queue, and being acknowledged in a - queue. -
queue_index_read_count - Number of records read from the queue index. -
queue_index_write_count - Number of records written to the queue index. -
rates_mode - 'none', 'basic' or 'detailed'. -
run_queue - Average number of Erlang processes waiting to run. -
running - Boolean for whether this node is up. Obviously if this is - false, most other stats will be missing. -
sasl_log_file - Location of sasl log file. -
sockets_total - File descriptors available for use as sockets. -
sockets_used - File descriptors used as sockets. -
type - 'disc' or 'ram'. -
uptime - Time since the Erlang VM started, in milliseconds. -
- -

/api/nodes/(name)

- -

- All of the above, plus: -

- - - - - - - - - - -
memory - Detailed memory use statistics. Only appears - if ?memory=true is appended to the URL. -
binary - Detailed breakdown of the owners of binary memory. Only - appears if ?binary=true is appended to the - URL. Note that this can be an expensive query if there are - many small binaries in the system. -
- -

/api/connections

-

/api/connections/(name)

- -

- See documentation for rabbitmqctl - list_connections. No additional fields, - although pid is replaced by node. -

- -

- Note also that while non-AMQP connections will appear in this - list (unlike rabbitmqctl list_connections), they - will omit many of the connection-level statistics. -

- -

/api/connections/(name)/channels

-

/api/channels

- -

- See documentation for rabbitmqctl list_channels, - with pid replaced by node, plus: -

- - - - - - - - - - -
connection_details - Some basic details about the owning connection. -
message_stats - See the section on message_stats above. -
- -

/api/channels/(name)

- -

- All the above, plus -

- - - - - - - - - - - - - - -
publishes - Detailed message stats (see section above) for publishes to - exchanges. -
deliveries - Detailed message stats for deliveries from queues. -
consumer_details - List of consumers on this channel, with some details on each. -
- -

/api/exchanges

-

/api/exchanges/(vhost)

- -

- See documentation for rabbitmqctl list_exchanges, plus: -

- - - - - - -
message_stats - See the section on message_stats above. -
- -

/api/exchanges/(vhost)/(name)

- -

- All the above, plus: -

- - - - - - - - - - -
incoming - Detailed message stats (see section above) for publishes - from channels into this exchange. -
outgoing - Detailed message stats for publishes from this exchange into - queues. -
- -

/api/queues

-

/api/queues/(vhost)

- -

- See documentation for rabbitmqctl list_queues, with - all references to pids replaced by nodes - plus: -

- - - - - - -
message_stats - See the section on message_stats above. -
- -

/api/queues/(vhost)/(name)

- -

- All the above, plus: -

- - - - - - - - - - - - - - -
incoming - Detailed message stats (see section above) for - publishes from exchanges into this queue. -
deliveries - Detailed message stats for deliveries from this queue into - channels. -
consumer_details - List of consumers on this channel, with some details on each. -
- -

/api/vhosts/

-

/api/vhosts/(name)

- -

- All the fields from rabbitmqctl list_vhosts - (i.e. name and tracing) plus: -

- - - - - - - - - - - - - - -
message_stats - Global message_stats for this vhost. Note that activity for - other users in this vhost is shown, even for users - without the monitoring tag. -
messages messages_ready messages_acknowledged - Sum of these fields for all queues in the vhost. -
recv_oct send_oct - Sum of these fields for all connections to the vhost. -
- - diff --git a/deps/rabbitmq_management/src/rabbit_mgmt_dispatcher.erl b/deps/rabbitmq_management/src/rabbit_mgmt_dispatcher.erl index dfccff6729..a30cbfb625 100644 --- a/deps/rabbitmq_management/src/rabbit_mgmt_dispatcher.erl +++ b/deps/rabbitmq_management/src/rabbit_mgmt_dispatcher.erl @@ -29,14 +29,16 @@ build_routes(Ignore) -> ManagementApp = module_app(?MODULE), Prefix = rabbit_mgmt_util:get_path_prefix(), RootIdxRtes = build_root_index_routes(Prefix, ManagementApp), - ApiRdrRte = build_static_index_html_route(Prefix, "/api"), - CliRdrRte = build_static_index_html_route(Prefix, "/cli"), + ApiRdrRte = build_redirect_route("/api", Prefix ++ "/api/index.html"), + CliRdrRte = build_redirect_route("/cli", Prefix ++ "/cli/index.html"), + StatsRdrRte1 = build_redirect_route("/stats", Prefix ++ "/api/index.html"), + StatsRdrRte2 = build_redirect_route("/doc/stats.html", Prefix ++ "/api/index.html"), MgmtRdrRte = {"/mgmt", rabbit_mgmt_wm_redirect, "/"}, LocalPaths = [{module_app(M), "www"} || M <- modules(Ignore)], LocalStaticRte = {"/[...]", rabbit_mgmt_wm_static, LocalPaths}, % NB: order is significant in the routing list Routes0 = build_module_routes(Ignore) ++ - [ApiRdrRte, CliRdrRte, MgmtRdrRte, LocalStaticRte], + [ApiRdrRte, CliRdrRte, MgmtRdrRte, StatsRdrRte1, StatsRdrRte2, LocalStaticRte], Routes1 = maybe_add_path_prefix(Routes0, Prefix), % NB: ensure the root routes are first Routes2 = RootIdxRtes ++ Routes1, @@ -48,10 +50,8 @@ build_root_index_routes(Prefix, ManagementApp) -> [{"/", rabbit_mgmt_wm_redirect, Prefix ++ "/"}, {Prefix, cowboy_static, root_idx_file(ManagementApp)}]. -build_static_index_html_route("", Path) -> - {Path, rabbit_mgmt_wm_redirect, Path ++ "/index.html"}; -build_static_index_html_route(Prefix, Path) -> - {Path, rabbit_mgmt_wm_redirect, Prefix ++ Path ++ "/index.html"}. +build_redirect_route(Path, Location) -> + {Path, rabbit_mgmt_wm_redirect, Location}. root_idx_file(ManagementApp) -> {priv_file, ManagementApp, "www/index.html"}. From 84641f59c879aa443c2225f16bd9d2ea7be4c065 Mon Sep 17 00:00:00 2001 From: Gerhard Lazu Date: Wed, 24 Apr 2019 10:20:11 +0100 Subject: [PATCH 2/2] Add stats HTTP redirect test --- deps/rabbitmq_management/test/rabbit_mgmt_http_SUITE.erl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deps/rabbitmq_management/test/rabbit_mgmt_http_SUITE.erl b/deps/rabbitmq_management/test/rabbit_mgmt_http_SUITE.erl index 80a9547d0a..11b64d0a22 100644 --- a/deps/rabbitmq_management/test/rabbit_mgmt_http_SUITE.erl +++ b/deps/rabbitmq_management/test/rabbit_mgmt_http_SUITE.erl @@ -58,6 +58,7 @@ groups() -> all_tests() -> [ cli_redirect_test, api_redirect_test, + stats_redirect_test, overview_test, auth_test, cluster_name_test, @@ -2986,6 +2987,10 @@ api_redirect_test(Config) -> assert_permanent_redirect(Config, "api", "/api/index.html"), passed. +stats_redirect_test(Config) -> + assert_permanent_redirect(Config, "doc/stats.html", "/api/index.html"), + passed. + %% ------------------------------------------------------------------- %% Helpers. %% -------------------------------------------------------------------