Commit Graph

763 Commits

Author SHA1 Message Date
Luke Bakken 47b70d8a8a Add TODO for queue limit validation
Validation code in place, how to display?

Take existing queue count into consideration

Server-side validation takes existing queue count into consideration. Improve error message sent back to web application.

Improve messaging, remove unused template

Take existing queues into account when importing definitions for all vhosts. Fix test suite.
2017-07-10 07:58:34 -07:00
Jean-Sébastien Pédron 7e8b67feed Merge branch 'stable' 2017-07-10 12:00:56 +02:00
Jean-Sébastien Pédron 142c5e90c4 rabbit_mgmt_http_SUITE: Wait in a loop for the connection to disappear
... instead of polling it once after 200 ms. This was failing from time
to time because of that timer:sleep() was sometimes too short.

Signed-off-by: Karl Nilsson <knilsson@pivotal.io>
2017-07-10 11:52:03 +02:00
Michael Klishin b7b324e213 Adapt this test for master (maps and all) 2017-06-19 23:59:34 +03:00
Michael Klishin 3dc76ea712 Merge branch 'stable' 2017-06-19 18:41:26 +03:00
Gabriele Santomaggio ca12fae27c Add unit test for columns filter with pagination 2017-06-19 11:39:53 +02:00
Daniil Fedotov acb7703910 Use rabbit_mgmt_format:args_hash to get args hash in bindings API and in tests.
args_hash changed in 3.7 to avoid incompatibilities in term_to_binary
2017-06-13 15:35:34 +01:00
Michael Klishin 632b51801a Merge branch 'master' into rabbitmq-management-405 2017-06-06 20:22:15 +03:00
Diana Corbacho bc76cff78c Manage topic permissions from the UI in user and vhost tabs
Added endpoint /topic-permissions/:vhost/:user/:exchange to
delete individual permissions

rabbitmq-management#405
[#146603709]
2017-06-05 19:20:29 +01:00
Daniil Fedotov 14d7805f1a Merge branch 'stable' 2017-05-31 14:28:12 +01:00
Daniil Fedotov adef9990ba Follow up to db928bceb5
Do not assume args hash in tests, because different erlang versions can
generate different hashes.
2017-05-31 14:25:31 +01:00
Daniil Fedotov d8e41a0083 Remove cleanup of non-existent option.
conn option is not added anywhere in the test suite.
OTP-20 tests will fail if end_per_testcase fails.
2017-05-31 14:01:54 +01:00
Daniil Fedotov db928bceb5 Do not assume bindings args hash in test.
Bindings args hash is using term_to_binary, which can change from
version to version in Erlang.
2017-05-31 13:40:59 +01:00
Daniil Fedotov f2b29af708 Do not assume bindings args hash in test.
Bindings args hash is using term_to_binary, which can change from
version to version in Erlang.
2017-05-31 12:07:22 +01:00
Daniil Fedotov 995fd236c8 Remove failing end_per_testcase clause.
There is no `conn` setting in test config, so `close_connection` will fail.
In Erlang-20 testsuite will fail if end_per_testcase fails.
2017-05-31 11:31:44 +01:00
Michael Klishin 4fa752acb6 Remove a few redundant includes 2017-05-09 13:34:50 +03:00
Michael Klishin 4adecc359f Merge branch 'stable'
Conflicts:
	src/rabbit_mgmt_util.erl
	src/rabbit_mgmt_wm_cluster_name.erl
	src/rabbit_mgmt_wm_global_parameter.erl
	src/rabbit_mgmt_wm_permission.erl
	src/rabbit_mgmt_wm_policy.erl
	src/rabbit_mgmt_wm_queue_get.erl
	src/rabbit_mgmt_wm_user.erl
	src/rabbit_mgmt_wm_vhost.erl
2017-05-09 13:22:22 +03:00
Michael Klishin 489edbffa9 Merge pull request #391 from rabbitmq/rabbitmq-management-377
Ensure cowboy Req is returned from `with_decode`
2017-05-04 10:38:40 +02:00
Jean-Sébastien Pédron a5afa86728 test/*_SUITE.erl: Include amqp_client.hrl in various testsuites
This header is required for its `amqp_msg` record.

rabbit_framing.hrl should be included too, for all the AMQP method
records, but it is already included from amqp_client.hrl and
rabbit_framing.hrl doesn't protect itself against multiple inclusions.

This commit fixes the build of the testsuite after the move of
rabbit_mgmt_test.hrl to rabbitmq-ct-helpers.
2017-05-04 10:32:46 +02:00
kjnilsson e36d77de72 Ensure cowboy Req is returned from `with_decode`
Reversing initial fix in 47a5ea7b1c

Usages of `with_decode` closed over the ReqData and returned the
instance before the bode decode. This had the effect of causing an error
after a  POST or PUT request had been issues on the same keep-alive
connection.
2017-05-04 08:09:39 +01:00
Daniil Fedotov 0ba32c914d Post-merge fixes 2017-05-03 13:55:45 +01:00
Daniil Fedotov 8cbffc8561 Merge branch 'stable' 2017-05-03 11:38:38 +01:00
Michael Klishin f64f808b7b Merge branch 'rabbitmq-management-384' into stable 2017-04-30 23:19:57 +02:00
Diana Corbacho d567370d56 Calculate average time per operation samples and averages
Samples didn't match averages as were reporting total times. Also,
rates do not make sense on time per operation so are all replaced
by the average.

rabbitmq-management#384
[#144393857]
2017-04-28 14:30:05 +01:00
Daniil Fedotov d0766f9a17 Move rabbit_mgmt_test_util to rabbitmq_ct_helpers to use in mgmg plugins tests 2017-04-28 12:42:21 +01:00
Michael Klishin b6982875de Merge branch 'stable' 2017-04-02 22:01:27 +03:00
Michael Klishin e5c921b4ae (c) year 2017-04-02 21:48:21 +03:00
Michael Klishin d3934be04b Merge branch 'stable'
Conflicts:
	src/rabbit_mgmt_util.erl
2017-03-24 22:21:03 +03:00
Alexey Lebedeff d61078d6d6 Add support for non-JSON encoding of replies
One of the low-hanging fruits in HTTP API optimization.
E.g. serializing information about 10000 queues:
- For JSON it takes 2 seconds on my machine and more than 1GB of RAM
- For BERT it takes 0.2 seconds and negligible amount of RAM
2017-03-24 11:57:03 +03:00
Daniil Fedotov 7845e06794 Config schema test for plugin
Part of [#141481501]
Moved from rabbitmq-server
2017-03-17 11:08:34 +00:00
kjnilsson 256563afb7 merge from stable 2017-03-02 16:23:23 +00:00
kjnilsson cb1d504128 Fix timing dependent test
[#140662033]
2017-03-01 15:14:28 +00:00
Jean-Sébastien Pédron 413ebdf92d Merge branch 'stable' 2017-02-24 11:03:34 +01:00
Jean-Sébastien Pédron 9118370dad cache_SUITE: Set log messages importance to ?LOW_IMPORTANCE 2017-02-24 11:00:17 +01:00
Jean-Sébastien Pédron a54bd12032 rabbit_mgmt_rabbitmqadmin_SUITE: Hard-code UTF-8-encoded queue name
... instead of using binary_to_list() on <<<"ööö"/utf8>>.

Erlang R16B03 took the "ö" individual bytes (from the two-byte encoded
UTF-8 character) and converted them to UTF-8. The queue was created with
the correct name because the correct UTF-8 string was passed to Python
and later to the management API. But because of the wrong conversion of
the expected queue name, the verification failed.
2017-02-24 10:48:30 +01:00
Michael Klishin 22d494463f Merge branch 'stable' 2017-02-07 16:33:44 +03:00
Gabriele Santomaggio 6be009edef Add unicode test for list queues 2017-02-07 12:10:11 +01:00
Michael Klishin 76a54f03f3 Merge pull request #333 from rabbitmq/rabbitmq-server-1085
Add read to topic permissions
2017-02-06 01:22:39 +03:00
Diana Corbacho 8e65173f4c Merge branch 'stable' 2017-02-02 12:10:13 +00:00
Gerhard Lazu 9cdca8a949 Merge pull request #342 from rabbitmq/rabbitmq-management-341
Report empty channel details if the information is missing during deletion
2017-02-02 11:43:18 +00:00
Diana Corbacho c27c14f19b Report empty channel details if the information is missing during deletion 2017-02-02 11:28:50 +00:00
Michael Klishin 82f38ce980 Provide no options to JSX just like we did here before 2017-02-01 18:11:45 +03:00
Michael Klishin e0cab9a540 A typo 2017-02-01 18:07:54 +03:00
Michael Klishin 0bb7ed6aea Switch to rabbit_json:decode/1 2017-02-01 17:53:32 +03:00
Michael Klishin a12dc17289 latin1 is sufficient (and safer) here 2017-02-01 16:07:43 +03:00
Michael Klishin 021b909fb9 merge branch 'master' 2017-02-01 15:42:06 +03:00
Jean-Sébastien Pédron 8cfa914395 rabbit_mgmt_http_SUITE: Fix incorrectly encoded URLs
`>` is unallowed in URI path segments according to RFC 3986. This
character must be percent-encoded.

Newer versions of Cowboy are stricter about this.

[#136779967]

(cherry picked from commit 85128761eb)
2017-02-01 12:45:07 +01:00
Jean-Sébastien Pédron 87e64f448a rabbit_mgmt_http_SUITE: Fix include directive
We must use `-include().` for a local file, not `-include_lib().`. Also,
fix the path to the header itself.

Reported by Syntastic.

(cherry picked from commit e09f94efc9)
2017-02-01 12:41:53 +01:00
Jean-Sébastien Pédron 85128761eb rabbit_mgmt_http_SUITE: Fix incorrectly encoded URLs
`>` is unallowed in URI path segments according to RFC 3986. This
character must be percent-encoded.

Newer versions of Cowboy are stricter about this.

[#136779967]
2017-02-01 12:25:11 +01:00
Jean-Sébastien Pédron 54df36fdc9 rabbit_mgmt_http_SUITE: rabbit_misc:pget/3 is unused
Reported by Syntastic.
2017-02-01 12:24:56 +01:00
Jean-Sébastien Pédron e09f94efc9 rabbit_mgmt_http_SUITE: Fix include directive
We must use `-include().` for a local file, not `-include_lib().`. Also,
fix the path to the header itself.

Reported by Syntastic.
2017-02-01 12:24:52 +01:00
Arnaud Cogoluègnes d9e0bb2dd9 Merge branch 'master' into rabbitmq-server-1085 2017-01-31 17:26:28 +01:00
Gabriele Santomaggio a5b1c8ffcb Replace the native call jsx with rabbit_json 2017-01-26 15:10:41 +01:00
Gabriele Santomaggio 60be1da071 Change latin1 to utf8 2017-01-26 14:31:43 +01:00
Gabriele Santomaggio b701f29ad1 Change the calls that uses the rabbit_json module
See :https://github.com/rabbitmq/rabbitmq-common/issues/164
2017-01-25 17:33:07 +01:00
Michael Klishin 1ad99a2f1b Merge branch 'stable'
Conflicts:
	src/rabbit_mgmt_wm_user.erl
	test/rabbit_mgmt_http_SUITE.erl
2017-01-24 01:01:16 +03:00
Arnaud Cogoluègnes 82dc7b950e Add read to topic permissions
Part of rabbitmq/rabbitmq-server#1085
2017-01-23 11:04:11 +01:00
Michael Klishin 6cefc447fa Test listing exchanges 2017-01-20 20:16:30 +03:00
Michael Klishin a6fa8a3c12 Merge branch 'master' into rabbitmq-event-exchange-10 2017-01-17 20:28:11 +03:00
Daniil Fedotov fe5cb85b36 Use cleaner vhost limit listing API 2017-01-17 13:04:06 +00:00
Diana Corbacho f6b67bbb21 Pass username from HTTP requests to all entities that notify events 2017-01-15 21:01:31 +00:00
Michael Klishin e6123b7782 Merge pull request #316 from rabbitmq/rabbitmq-server-505
Add topic permissions endpoints
2017-01-13 15:07:04 +03:00
Gabriele Santomaggio 122c38faa0 Change JSON format for Limits API 2017-01-12 17:58:39 +01:00
Michael Klishin 24fab88db4 Merge branch 'master' into rabbitmq-server-505 2017-01-12 12:58:35 +03:00
Michael Klishin 476ed02f55 More tests 2017-01-09 19:06:58 +08:00
Michael Klishin bfa7a766ec Wire credential validation into PUT /api/users/{user}; fix a bug as a drive-by
Previously when no password or password hash were provided, a user with
generated credentials was created with the intent to later update
the user's credentials. Should anything fail after that, the user record
would be "leaked." The tests we had turned a blind eye on that scenario.
2017-01-09 18:41:47 +08:00
Arnaud Cogoluègnes 73e34e707f Use exchange instead of name in topic permission
References rabbitmq/rabbitmq-server#505
2017-01-03 12:15:26 +01:00
Michael Klishin 3bf0f02306 Switch operator policies and vhost limit endpoints to use dashes
Like we already do with aliveness-check and a few other things.
These endpoints are new in 3.7.0/master and we should unify them while
we can.

Per suggestion from @acogoluegnes.

References rabbitmq/rabbitmq-server#500, rabbitmq/rabbitmq-server#501,
rabbitmq/rabbitmq-server#930.
2017-01-03 18:58:18 +08:00
Arnaud Cogoluègnes aecb9b5470 Add topic permissions endpoints
References rabbitmq/rabbitmq-server#505
2016-12-27 12:18:23 +01:00
Arnaud Cogoluègnes 6869be6543 Merge branch 'stable'
Conflicts:
	src/rabbit_mgmt_util.erl
	test/rabbit_mgmt_http_SUITE.erl
2016-12-16 11:37:42 +01:00
Arnaud Cogoluègnes d4a5ca2ab1 Fix global parameters test
References rabbitmq/rabbitmq-mqtt#73
2016-12-14 16:25:34 +01:00
Arnaud Cogoluègnes 0e97a331ff Support global parameters in HTTP API
Part of rabbitmq/rabbitmq-mqtt-73.
2016-12-14 12:18:52 +01:00
Jean-Sébastien Pédron bd59e8ed61 Merge branch 'stable' 2016-12-08 17:06:35 +01:00
Jean-Sébastien Pédron 0b43d76365 rabbit_mgmt_test_db_SUITE: Double first timer in queue_coarse_test()
It is an arbitrary factor but it makes CI happy.
2016-12-08 17:04:27 +01:00
Jean-Sébastien Pédron 8070e8ca8a Merge branch 'stable' 2016-12-08 10:12:14 +01:00
Diana Corbacho 5f1e0a3103 Merge remote-tracking branch 'origin/rabbitmq-management-236' 2016-12-05 17:18:57 +00:00
kjnilsson cb2ae13d04 reset collector old_aggr_stats after each tests in clustering_SUITE 2016-12-02 12:36:56 +00:00
kjnilsson 9ac32d3be6 Test tidy up 2016-11-30 12:35:57 +00:00
Michael Klishin cc70930bd7 Merge pull request #303 from rabbitmq/rabbitmq-management-301
Fix CORS preflight requests
2016-11-29 16:41:46 +03:00
Loïc Hoguin 16e023000e Fix CORS preflight requests
Credentials are never sent with preflight requests, and preflight
requests are only accepted if they return successfully (eg 200).
We returned a 401 when credentials were missing so browsers rejected
the response.
2016-11-29 14:20:25 +01:00
kjnilsson b43169db94 Move collectors and related modules to rabbitmq_management_agent 2016-11-29 13:16:13 +00:00
Loïc Hoguin 15192b6978 Fix CORS preflight requests
Credentials are never sent with preflight requests, and preflight
requests are only accepted if they return successfully (eg 200).
We returned a 401 when credentials were missing so browsers rejected
the response.
2016-11-29 13:47:50 +01:00
kjnilsson 643ced5f15 Tidy up removal of the old_aggr_stats table 2016-11-25 12:06:26 +00:00
kjnilsson 7a3a2ef89b Reduce GC operations by keeping the old stats in each collector
process instead of ETS.
2016-11-25 11:22:43 +00:00
Loïc Hoguin 50977a15cd Rename mochiweb_util 2016-11-24 16:27:13 +01:00
kjnilsson dcf0a407de Increase range for mgmt_test_db time-sensitive tests 2016-11-23 14:41:09 +00:00
kjnilsson 4f445a400e Fix issue where the slide would occasionally zero pad incorrectly 2016-11-23 14:41:09 +00:00
kjnilsson 9394a08ca4 Delay slide summing until formatting to avoid normalizing twice. Now uses ceil as only normalization strategy.
Dialyzer fixes and refactoring
2016-11-23 14:41:09 +00:00
kjnilsson fba335de39 Set last timestamp when summing slides 2016-11-23 14:40:40 +00:00
kjnilsson ce5f699d0c Ensure drop expansion is bounded 2016-11-23 14:40:40 +00:00
kjnilsson bab9beeb3d Padding fixes and test adjustments 2016-11-23 14:40:40 +00:00
kjnilsson 2f96ab8236 Remove problematic clause from maybe_add_last_sample 2016-11-23 14:40:40 +00:00
kjnilsson 4f4064c589 exometer_slide:to_list should realise the last sample 2016-11-23 14:40:18 +00:00
kjnilsson 41d507d550 Fix issue with summing non-incremental slides as well as recording the first timestamp
Don't arbitrarily extend the query range
2016-11-23 14:40:05 +00:00
kjnilsson 7f7d489561 Solidify the behaviour of exometer_slide:to_normalized_list to only pad values that are possible to deduce.
Dialyzer fixes
2016-11-23 14:40:05 +00:00
kjnilsson e8655442b4 Refactor exometer_slide:normalize into to_normalized_list 2016-11-23 14:40:05 +00:00
Diana Corbacho 8561c18146 Make rabbit_mgmt_stats time independent 2016-11-23 14:40:05 +00:00
Diana Corbacho b1af85530a Remove unused code, simplify tests 2016-11-23 14:40:05 +00:00
Diana Corbacho df23b1f001 Fix sliding window 2016-11-23 14:40:05 +00:00
Diana Corbacho 80c289462d Fill with zeros samples previous to the beginning of the slide 2016-11-23 14:40:05 +00:00
kjnilsson c685b9b54c exometer_slide fixes 2016-11-23 14:39:47 +00:00
Diana Corbacho 35085496e0 Verify increment is all 0s before applying drop 2016-11-23 14:39:47 +00:00
Diana Corbacho c3cfc4ace4 More exometer:foldl fixes. Run parallel tests in parallel 2016-11-23 14:39:47 +00:00
kjnilsson 3ac4cb80a5 exometer_slide:foldl fixes 2016-11-23 14:39:47 +00:00
kjnilsson b3ce8adecc exometer_slide: ensure to_list applies take_since to buf1 2016-11-23 14:39:47 +00:00
Diana Corbacho 4fabc5a281 Do not store unchanging stats after two duplicated samples 2016-11-23 14:39:47 +00:00
Diana Corbacho 5ccdff2722 Insert channel stats directly into ETS tables 2016-11-23 14:39:47 +00:00
kjnilsson db52c69251 optimize slides when read to reduce memory use. 2016-11-23 14:39:37 +00:00
kjnilsson f0135d21ab Invalidate management db cache when a different argument is called 2016-11-23 14:39:37 +00:00
kjnilsson 7d2cc4b743 exometer_slide: only realise an partial/intermediary sample if at least a full interval has passed since the last sample 2016-11-23 14:39:37 +00:00
kjnilsson c94867bcaa Add property test to validate connection and channel counts are consistent across the cluster 2016-11-23 14:39:37 +00:00
Diana Corbacho e9e161deff Use total for rates, fixed more stats and tests 2016-11-23 14:39:36 +00:00
kjnilsson 86cbf76c60 exometer_slide:sum - take the ceil instead of round when summing timestamps to reduce the chance of the last sample only being partial 2016-11-23 14:39:36 +00:00
kjnilsson c782952d34 Use most recent timestamp as reference point for exometer_slide:sum instead of current timestamp 2016-11-23 14:39:36 +00:00
kjnilsson c766343b7c augment message stats in delegate call 2016-11-23 14:39:35 +00:00
kjnilsson 23216d3f71 Improve how exometer_slide sums incremental slides.
Add some basic unit tests.
Changed exometer_slide:last_two function to only return fully realised samples
2016-11-23 14:39:22 +00:00
kjnilsson 641e2e39c9 Insert stats using the correct retention policies 2016-11-23 14:39:22 +00:00
kjnilsson 0c006a14cf Implement caching for channels and connections 2016-11-23 14:39:09 +00:00
kjnilsson 1d41ddb7e1 Make mgmt_db_cache start new gen_server for non-existent keys 2016-11-23 14:39:09 +00:00
kjnilsson 98199b3c53 Cache calls don't need to go through worker pool 2016-11-23 14:39:09 +00:00
kjnilsson e4ec999783 License headers 2016-11-23 14:39:09 +00:00
kjnilsson 547bab2b34 Implement adaptive cache to ensure remote queries aren't allowed overflow the system.
Ensure exometer_slides are created with a max_n or else they will never truncate the window
2016-11-23 14:39:09 +00:00
kjnilsson aa692347ce Minor documentation changes 2016-11-23 14:39:09 +00:00
kjnilsson 2cd1466dcd Assert cluster links are present in nodes query 2016-11-23 14:39:09 +00:00
kjnilsson f882be7780 Detailed stats for nodes 2016-11-23 14:39:09 +00:00
kjnilsson 53671fa821 Exchange and channel detailed stats 2016-11-23 14:39:08 +00:00
kjnilsson d6b4c6087d Implement detailed stats for queue
Made strip_pids recursive
2016-11-23 14:39:08 +00:00
kjnilsson 13275fd1ad Move delegation for consumers query to rabbig_mgmt_db 2016-11-23 14:39:08 +00:00
kjnilsson dfb639a12d remove force_all from rabbit_mgmt_metrics_collector 2016-11-23 14:39:08 +00:00
Diana Corbacho 6216378688 Replace ?FUNCTION_NAME macro by function names to support pre-19 2016-11-23 14:39:08 +00:00
kjnilsson 77b816e492 Fix overview test 2016-11-23 14:39:08 +00:00
Diana Corbacho 8ba208f05d Range, samples and avg tests. Fixed JSON output tags. 2016-11-23 14:39:08 +00:00
kjnilsson 619211f792 overview query
dialyzer fixes
2016-11-23 14:38:56 +00:00
Diana Corbacho 88b5944fd1 Always report actual total on stats. 2016-11-23 14:38:56 +00:00
Loïc Hoguin 2c93a16ea5 Use python2 in the rabbitmqadmin test suite
It's not compatible with Python 3 (or at least 3.5).
2016-11-08 15:17:44 +02:00
Loïc Hoguin 28ca2413d3 Switch JSON library to JSX 2016-11-08 15:17:44 +02:00
Daniil Fedotov 93df289366 Updated limits page to edit limits. Updated policies page to create operator policies 2016-10-03 13:06:16 +01:00
kjnilsson d66c09d153 Merge branch 'rabbitmq-management-236' of github.com:rabbitmq/rabbitmq-management into rabbitmq-management-236 2016-09-27 14:19:07 +01:00
kjnilsson 191ce9b2b9 merge stable 2016-09-27 14:18:02 +01:00
kjnilsson a65b7a555f Distributed query for overview totals 2016-09-27 13:59:46 +01:00
Diana Corbacho f3164a46ce Fix node_persister_stats and add tests for incremental counters 2016-09-27 10:42:13 +01:00
kjnilsson c686f6a260 Distributed node(s) stats query 2016-09-27 08:31:39 +01:00
kjnilsson 3d703e941f Distributed vhost(s) stats query 2016-09-26 16:31:41 +01:00
Diana Corbacho 35d5c4454f Test format rates 2016-09-26 15:30:47 +01:00
kjnilsson 99b5dbd8c8 Distributed exchange(s) stats query 2016-09-26 12:50:32 +01:00
kjnilsson bf3be9430e Distributed connection stats query 2016-09-26 10:55:37 +01:00
kjnilsson 681cdce41c Move delegate calls to mgmt_db for channel queries 2016-09-23 13:49:49 +01:00
kjnilsson 15230577e2 Call delegate in mgmt_db instead for queue queries 2016-09-23 10:14:42 +01:00
Diana Corbacho 358cc09109 Fix and testing of instant rates 2016-09-21 22:59:01 +01:00
kjnilsson 49f0c56768 Distributed query for consumers 2016-09-20 10:13:08 +01:00
kjnilsson 0ef7c8c0e1 Move clean_consumer_details function into rabbit_mgmt_format 2016-09-19 15:28:09 +01:00
kjnilsson 703312baf8 Implement channel queries using multiple delegate calls.
Remove channel_consumer
2016-09-19 14:36:32 +01:00
kjnilsson 04a9004b8d Distributed querying for channels and channel
channel queries now perform an additional query to get the consumer detials once
the channel pids are known
2016-09-16 13:15:28 +01:00
kjnilsson 7b8eddb765 Add distributed query for queues 2016-09-14 14:44:15 +01:00
kjnilsson 761181aeaa Handle channel_consumer_deleted event
Test refactoring
2016-09-14 09:14:58 +01:00
kjnilsson 842cf970da Ensure ?CORE_TABLE tuples are deconstructed 2016-09-13 17:04:50 +01:00
kjnilsson 218b29dee5 merge 2016-09-13 15:56:18 +01:00
kjnilsson 1484443847 distributed queue query
introduce channel consumer stats to track consumers from a channel node
2016-09-13 15:53:51 +01:00
Diana Corbacho 2895476f05 Update test to expect HTTP 201 2016-09-13 15:43:28 +01:00
Loïc Hoguin 413a95bba0 Add CORS support
Two new options: cors_allow_origins and cors_max_age.

* cors_allow_origins: list of origins allowed, for example
  ["http://rabbitmq.com", "http://pivotal.com"];
  or ["*"] to allow everything.

* cors_max_age: time in seconds that clients may cache
  preflight requests. It defaults to 30 minutes.

This also fixes an issue with compressed replies where
"accept-encoding" was not added to the "vary" header.

(cherry picked from commit d10ed61736)
2016-09-13 13:03:24 +02:00
Loïc Hoguin 9121b68508 Use Cowboy REST instead of Webmachine
As part of a push to reduce the number of dependencies from the
RabbitMQ project, the management plugin needed to be converted
from Webmachine to Cowboy REST.

Most of this commit is about the conversion from Webmachine to
Cowboy. The main differences are in the POST handling where Cowboy
and Webmachine differ, but also in the conversion from string to
binary as Webmachine uses the former and Cowboy the latter.

The logging mechanism has been moved to the Web Dispatch plugin.
The mochiweb_util has been added for now, as it is currently still
required for some functionality missing from Cowboy. It can be
refactored out in the future.

The responses to POST and PUT requests may give a different result
under Cowboy compared to Webmachine. In particular, where Webmachine
used to return 204 No Content for all PUT requests, Cowboy may
return either 201 Created or 204 No Content. The test suite had to
be heavily updated to take this into account, but most clients will
have no problem with it since they only check for 2xx. And more
information can be considered a definite improvement.

(cherry picked from commit 242843ac9c)
2016-09-13 13:03:24 +02:00
kjnilsson 346a6b91ca merge 2016-09-09 12:44:27 +01:00
kjnilsson 401b5967ea basic distributed queue query 2016-09-09 12:43:29 +01:00
Diana Corbacho 428f510048 Ensure actuals are reported in overview for aggregated data 2016-09-09 12:40:52 +01:00
Diana Corbacho e616edfdf6 Add Proper tests for added functionality to exometer_slide 2016-09-07 09:09:42 +01:00
Diana Corbacho 39a1154659 Update http test suite 2016-09-06 11:21:41 +01:00
Diana Corbacho 31204b424a Update DB test suite 2016-09-06 11:21:35 +01:00
Diana Corbacho e9dba7bb7e Mgmt memory report and test 2016-09-02 09:00:07 +01:00
Michael Klishin fb7550c3b5 Finish support for operator policies in HTTP API and rabbitmqadmin 2016-09-01 18:13:42 +03:00
Diana Corbacho 0f139227c5 Merge branch 'stable' 2016-08-22 13:47:48 +01:00
Diana Corbacho d9ef0b723f Test return of duplicated keys in /queues 2016-08-22 12:39:32 +01:00
Michael Klishin 3e58830713 Merge branch 'stable' 2016-08-02 07:08:44 -07:00
Diana Corbacho b8253adddc Restore db test suite 2016-08-02 09:32:21 +01:00
kjnilsson 3b66c8a168 merge from 'stable' and changes for 'ackmode' 2016-07-21 13:01:49 +01:00
kjnilsson 3b4993573d Translate rabbitmqadmin tests from python to erlang
fix travis build
2016-07-21 10:03:26 +01:00
kjnilsson 265b6a3c57 add rabbit_mgmt_runtime_parameters to break
rabbitmq-test dependency
squash a few warnings
2016-07-19 11:38:01 +01:00
kjnilsson fcf827d779 add mochiweb as a dependency
add rabbit_mgmt_runtime_parameters_util.erl to break dependency on
rabbitmq-test

squash a few warnings
2016-07-19 11:25:32 +01:00
Jean-Sébastien Pédron eeba7c1d8c Use `rand` directly in master because we require Erlang 18.3
References rabbitmq/rabbitmq-server#860.
[#122335241]
2016-06-29 16:42:38 +02:00
Jean-Sébastien Pédron 50644ea181 Merge branch 'stable' 2016-06-29 16:42:21 +02:00
Jean-Sébastien Pédron 6538816442 Use the new `rand_compat` module to transition from `random` to `rand`
References rabbitmq/rabbitmq-server#860.
[#122335241]
2016-06-29 16:40:17 +02:00
Michael Klishin 124c714a66 Merge branch 'stable' 2016-06-25 01:21:01 +03:00
Michael Klishin 7dcfe6d4cd Switch test suite to Common Test, fixes #233
Squashed commit of the following:

commit b104a7f84474e247dfef27cd389d6fac554ab634
Author: Michael Klishin <michael@clojurewerkz.org>
Date:   Thu Jun 23 18:14:28 2016 +0300

    Finish migration to CT

    Note: this intentionally deletes several tests that depend on ETS
    table state and clash with "real" stats GC processes running in parallel.
    Some of them are covered in other test suites, e.g. rabbit-hole, others
    can only really be tested with a separate simulation test suite.

    Per discussion with the team.

commit 7585883e0f9432fd3360d18d340bcf599ad8d51f
Author: Michael Klishin <michael@clojurewerkz.org>
Date:   Thu Jun 23 15:50:53 2016 +0300

    Down to 3 failing tests

commit 3243f0efed7033229803404a431c1c6404c25677
Author: Michael Klishin <michael@clojurewerkz.org>
Date:   Tue Jun 21 01:02:42 2016 +0300

    Attempts to simplify a few tests for CT

commit 997c2b3782b4ce38708658dc90883980a267a461
Merge: 122c7b7 0ce4f6b
Author: Michael Klishin <michael@clojurewerkz.org>
Date:   Fri Jun 17 14:45:06 2016 +0300

    Merge branch 'stable' into common_test

commit 122c7b7116778e9aff244822933eaf95567dc59d
Author: Michael Klishin <michael@clojurewerkz.org>
Date:   Thu Jun 16 18:19:28 2016 +0300

    Begin porting test_db_SUITE

commit 872f3e82966999cebd8ba966daac9410badaca09
Author: Michael Klishin <michael@clojurewerkz.org>
Date:   Thu Jun 16 13:54:34 2016 +0300

    Makes clustering_SUITE pass

commit c8d6c89bda6e7571877221ed6b2513e53b1ebc46
Author: Michael Klishin <michael@clojurewerkz.org>
Date:   Thu Jun 16 03:48:54 2016 +0300

    Towards clustering_SUITE

commit 7fcb6c834039d6cdf15371ce8640f6dfd9bdf939
Author: Michael Klishin <michael@clojurewerkz.org>
Date:   Thu Jun 16 02:59:24 2016 +0300

    Initial clustering_SUITE test passes

commit 11205579e86bad4563e027d025b94f0e57ee8386
Author: Michael Klishin <michael@clojurewerkz.org>
Date:   Thu Jun 16 02:59:12 2016 +0300

    Add mochiweb to test dependencies

commit 895ff82e6e6567336c2ac56532f82427a2c4f705
Author: Michael Klishin <michael@clojurewerkz.org>
Date:   Thu Jun 16 01:09:46 2016 +0300

    Refactor

commit 6d9200cc8516ee5ea0676fbb0e9b3c88fb2a40a7
Author: Michael Klishin <michael@clojurewerkz.org>
Date:   Thu Jun 16 00:55:08 2016 +0300

    open_unmanaged_connection/1 is now available in rabbit_ct_client_helpers

commit 40d03cd2fa2a6bc1d4c7c4a1eeb332c5182e1317
Author: Michael Klishin <michael@clojurewerkz.org>
Date:   Wed Jun 15 23:51:31 2016 +0300

    All http_SUITE tests now pass

commit 81e08ef36a08884c02fabd51662018751035b5b6
Author: Michael Klishin <michael@clojurewerkz.org>
Date:   Wed Jun 15 17:12:27 2016 +0300

    More tests pass with Common Test

commit aaea771db14624df0db944b4c4d0eb42191fb961
Author: Michael Klishin <michael@clojurewerkz.org>
Date:   Tue Jun 14 17:41:09 2016 +0300

    Continue adapting to Common Test

commit 0a57f3256a828a835ce44ef02b2e93a3cfe34ccf
Author: Michael Klishin <michael@clojurewerkz.org>
Date:   Tue Jun 14 15:28:19 2016 +0300

    Begin moving test suite to Common Test
2016-06-24 13:27:05 +03:00
Daniil Fedotov 1ab076cfa5 Merge branch 'stable' 2016-06-07 15:21:13 +01:00
Daniil Fedotov 2309bb36c1 API endpoint to show per-table ETS memory consumption 2016-06-07 13:30:36 +01:00
Michael Klishin f819219d91 Merge branch 'stable' 2016-05-13 00:16:58 +08:00
Daniil Fedotov 8599f3bcde Matching wait 2016-05-11 17:14:05 +01:00
Daniil Fedotov ace344e9ce Improve tests timing 2016-05-11 16:43:21 +01:00
Daniil Fedotov d2ed45060c Delete connection and channel stats indexes 2016-05-10 16:44:26 +01:00
Daniil Fedotov a1f1775d73 Channel and connection stats GC 2016-05-10 15:05:13 +01:00
Gabriele Santomaggio 3b9ac547ad Modified ACK modes in "Get messages"
Issue #68
[#118655225]
2016-05-09 13:47:38 +01:00
Michael Klishin 75287e91d2 Merge branch 'stable' 2016-04-19 08:06:38 -07:00
Michael Klishin a22b4a7aca Merge branch 'stable' into rabbitmq-management-41 2016-04-19 08:01:10 -07:00
Diana Corbacho a2ada3f4db Add a test case for bogus connections 2016-04-19 15:58:13 +01:00
Diana Corbacho a869808c44 Merge branch 'stable'
Conflicts:
	src/rabbit_mgmt_dispatcher.erl
2016-04-18 16:42:59 +01:00
Diana Corbacho d17533c1f0 Return relative total as 100% 2016-04-18 13:15:30 +01:00
Diana Corbacho fa8964b2f9 Add relative memory endpoint 2016-04-18 08:33:34 +01:00
Diana Corbacho 82bf890c3e New memory endpoint 2016-04-15 17:20:50 +01:00
Michael Klishin 28060d517b merge stable into master 2016-04-13 00:22:50 +03:00
Loïc Hoguin d10ed61736 Add CORS support
Two new options: cors_allow_origins and cors_max_age.

* cors_allow_origins: list of origins allowed, for example
  ["http://rabbitmq.com", "http://pivotal.com"];
  or ["*"] to allow everything.

* cors_max_age: time in seconds that clients may cache
  preflight requests. It defaults to 30 minutes.

This also fixes an issue with compressed replies where
"accept-encoding" was not added to the "vary" header.
2016-04-11 17:51:22 +02:00
Michael Klishin 428747f53e Merge branch 'stable' into rabbitmq-management-157 2016-04-05 17:50:05 -07:00
Diana Corbacho cb8e840a53 Fix gc of indexes
* The key of the main table is the object in the index table
2016-04-05 13:05:33 +01:00
Loïc Hoguin 1ae44f86a2 Add CORS support
Two new options: cors_allow_origins and cors_max_age.

* cors_allow_origins: list of origins allowed, for example
  ["http://rabbitmq.com", "http://pivotal.com"];
  or ["*"] to allow everything.

* cors_max_age: time in seconds that clients may cache
  preflight requests. It defaults to 30 minutes.
2016-04-04 16:23:29 +02:00
Daniil Fedotov c558ebf463 Merge branch 'stable' 2016-03-24 14:19:53 +00:00
Daniil Fedotov 9549da9928 Revert "Management parameters access test"
This reverts commit e9f4f376d8.
2016-03-24 14:14:13 +00:00
Michael Klishin 69fd526c93 Merge branch 'stable' 2016-03-23 08:38:47 +03:00
Daniil Fedotov e9f4f376d8 Management parameters access test 2016-03-22 14:44:55 +00:00
Daniil Fedotov 91bf65d139 Enable read-only access to policies for management and monitoring users 2016-03-22 10:40:05 +00:00
Michael Klishin ee7c535c8c Merge branch 'stable' 2016-03-03 21:15:59 +03:00
Diana Corbacho e941706672 Merge remote-tracking branch 'rabbitmq-server-398'
Conflicts:
	src/rabbit_mgmt_dispatcher.erl
2016-03-03 12:51:44 +00:00
Diana Corbacho 7f664205ef Store cluster name as binary from the HTTP API 2016-03-03 08:59:12 +00:00
Michael Klishin e7ebae7362 Merge branch 'stable' into rabbitmq-management-41 2016-03-03 02:20:04 +03:00
Diana Corbacho cd824e0857 Revert timestamp performance improvement
The querying of the metrics from the UI uses a 5 sec windows to return
the rate, stats older than that are considered old and the instant rate
returned as 0.0. It could be the case that on very slow queries, many
thousands of items (over 50k queues in a new 2015 MacBook), the response
time is over 5 seconds and thus some rates could be reported as 0.0 if the
Now timestamp is collected in advance. Note that this behaviour hasn't been
confirmed.
2016-02-29 17:57:02 +00:00
Diana Corbacho 8ea2eb8f75 Node health checks endpoint
* /healthchecks/node
* /healthchecks/node/<node>
2016-02-25 16:39:54 +00:00
Diana Corbacho 3b54ade078 Fix unit tests
* Make them order-independent
2016-02-19 15:37:46 +00:00
Michael Klishin 397a9d2f71 Merge branch 'stable' into rabbitmq-management-41
Conflicts:
  src/rabbit_mgmt_wm_queue.erl
  test/src/rabbit_mgmt_test_http.erl
2016-02-19 17:47:52 +03:00
Michael Klishin 28b36fa12f Accept both 201 Created and 204 No Content
This is one of the differences
between Mochiweb in stable and Cowboy REST in master.
2016-02-19 10:13:43 +03:00
Michael Klishin bee0b822f0 Accept both 201 Created and 204 No Content
This is one of the differences
between Mochiweb in stable and Cowboy REST in master.
2016-02-19 10:13:12 +03:00
Diana Corbacho 9f2ba75616 Merge branch 'stable'
Conflicts:
	src/rabbit_mgmt_dispatcher.erl
	src/rabbit_mgmt_wm_definitions.erl
2016-02-18 14:29:08 +00:00
Loïc Hoguin 9d16301819 Properly redirect on definitions upload success 2016-02-18 10:48:20 +01:00
Diana Corbacho 6f58c083b1 Add tests 2016-02-17 18:42:56 +00:00
Diana Corbacho a98815426d Minor fix and tests 2016-02-08 09:35:27 +00:00
Diana Corbacho 25b5da5dbd Optimisations 2016-02-05 08:10:42 +00:00
Michael Klishin 320b85b3a4 Merge branch 'stable' 2016-01-29 04:17:52 +03:00
Michael Klishin f54e2f986c Cherry-pick a fix for #122 to stable, resolve conflicts 2016-01-29 04:16:29 +03:00
Michael Klishin aa503ec78e Accept either 201 Created or 204 No Content
Fixes #122.
2016-01-29 04:06:56 +03:00
Michael Klishin c599022ffb Merge stable into master, tests need #122 and #121 to pass 2016-01-29 03:41:15 +03:00
Michael Klishin f226bbe230 Cowboy uses 204 No Content 2016-01-29 03:16:46 +03:00
Michael Klishin a5bb55cc11 Merge branch 'stable' 2016-01-29 03:06:04 +03:00
Michael Klishin da263fbcfe Typos, copy edits, cosmetics 2016-01-29 02:54:24 +03:00
Daniil Fedotov 8e3cfd0d82 Test fixes 2016-01-28 15:33:53 +00:00
Daniil Fedotov 0f07224e36 Tests for hashing algorithm in definitions 2016-01-28 15:22:42 +00:00
Daniil Fedotov 01c17c3a21 Test fixes 2016-01-28 12:14:56 +00:00
Diana Corbacho b99df47451 Use an additional index to avoid overlap insert/delete 2016-01-19 15:19:12 +00:00
Michael Klishin af858d5f24 Merge branch 'stable' 2016-01-19 00:10:01 +03:00
Diana Corbacho 5edea6aac4 Use indexes 2016-01-18 17:21:18 +00:00
Loïc Hoguin 039382774e Send a 400 error when the range age/incr values are invalid 2016-01-18 14:14:20 +01:00
Diana Corbacho 62cf32504c Aggregate stats in records 2016-01-06 09:31:03 +01:00
Diana Corbacho 82cfca72c9 Aggregated stats in ETS tables per type 2016-01-06 09:31:03 +01:00
Diana Corbacho 2354f4fbfb Using ETS in mgmt_stats 2016-01-06 09:31:01 +01:00
Diana Corbacho 9d7add84e0 Calculate tree total in event-time 2016-01-06 09:31:01 +01:00
Robby Raschke 5a1d369956 Split the mgmt db code into writer (rabbit_mgmt_event_collector) and reader (rabbit_mgmt_db). 2016-01-06 09:31:01 +01:00
Michael Klishin 022699b390 Merge branch 'stable' 2016-01-01 13:10:47 +03:00
Michael Klishin 890c94e0a3 Update (c) info 2016-01-01 12:59:18 +03:00
Loïc Hoguin 5ce4f4ef87 Accept files when posting definitions
Adds a test to ensure this regression does not come back.
2015-12-28 13:16:22 +01:00
Loïc Hoguin 242843ac9c Use Cowboy REST instead of Webmachine
As part of a push to reduce the number of dependencies from the
RabbitMQ project, the management plugin needed to be converted
from Webmachine to Cowboy REST.

Most of this commit is about the conversion from Webmachine to
Cowboy. The main differences are in the POST handling where Cowboy
and Webmachine differ, but also in the conversion from string to
binary as Webmachine uses the former and Cowboy the latter.

The logging mechanism has been moved to the Web Dispatch plugin.
The mochiweb_util has been added for now, as it is currently still
required for some functionality missing from Cowboy. It can be
refactored out in the future.

The responses to POST and PUT requests may give a different result
under Cowboy compared to Webmachine. In particular, where Webmachine
used to return 204 No Content for all PUT requests, Cowboy may
return either 201 Created or 204 No Content. The test suite had to
be heavily updated to take this into account, but most clients will
have no problem with it since they only check for 2xx. And more
information can be considered a definite improvement.
2015-12-21 18:13:30 +01:00
Michael Klishin 26079a23db Merge branch 'master' into rabbitmq-management-50 2015-11-19 15:29:00 +03:00
Gabriele Santomaggio 27c4845733 unit tests 2015-11-18 16:42:01 +01:00
Jean-Sébastien Pédron 797717807b make tests: Set $RABBITMQADMIN in the Makefile
The testsuite uses this variable instead of constructing the path to
rabbitmqadmin itself.
2015-11-16 16:33:19 +01:00
Gabriele Santomaggio 05ebdae4e1 filter by name 2015-11-12 22:25:01 +01:00
Michael Klishin 48dbf5784d Rename keys 2015-11-03 12:14:26 +03:00