This library is created to make a possibility to read various statistics from RabbitMQ management plugin API. It can be used either in syncronous, or asyncronous code.
More about management plugin and it's API:
- https://www.rabbitmq.com/management.html
- https://rawcdn.githack.com/rabbitmq/rabbitmq-server/v3.12.12/deps/rabbitmq_management/priv/www/api/index.html
To use this library you will need the running RabbitMQ instance with installed management plugin.
nimble install amqpstats
Simple examples. For complete info see library API or test.nim
import amqpstats
let statsM = newAMQPStats(url = "http://localhost:15672", user = "guest", passwd = "guest")
let overview = statsM.overview()
import amqpstats
let statsM = newAMQPStats(url = "http://localhost:15672", user = "guest", passwd = "guest")
let overview = await statsM.overview()
To start tests you should clone this repository and either:
Run nimble test
inside the repo directory.
This will attempt to connecto to working RabbitMQ instance using HOST
, USER
and PASSWD
variables defined in test.nim.
Run nimble test -DlocalTest
.
This will switch the logic of testing and just read the predefined json files in tests directory which you should provide.