Skip to content

amirhnajafiz/havij

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Havij

Test your RabbitMQ service with a Havij (aka Carrot). Havij checks your rabbitMQ service by subscribing and publishing over topics with Golang workers. After that it will give you metrics that shows your rabbitMQ service status. You can set the configs and then test your MQTT server.

Configs

Copy the example config file:

cp ./configs/example-config.yaml ./config.yaml

Basic things you need to set:

...
rabbit:
  host: "[string] RabbitMQ service address"
...
consumers: "[int] number of subscribers"
providers: "[int] number of publishers"
time_out: "[int] timeout for messages"

Now you can set the RabbitMQT address and some configs for the testing environment, like the number of tests, message timeout and ...

Start

Go

Execute the main go file:

go run main.go

Docker

Build and run with docker:

docker build . -t havij
docker run -d -p 2112:2112 havij

Metrics will be exposed as Prometheus metrics over localhost:2112/metrics.

Test

You can run the project on docker (with a RabbitMQ service) with following command:

docker-compose up -d

Now you can get the test results in log.txt file in carrot container, in app directory.

Testing result sample:

2022/04/14 10:53:13 start testing
2022/04/14 10:53:13 [storage 1970-01-01 03:30:00 +0330 +0330][duration 42.324375ms][timeout false]: Consequatur aut perferendis voluptatem sit accusantium. 
2022/04/14 10:53:13 [storage 1970-01-01 03:30:00.001 +0330 +0330][duration 46.428959ms][timeout false]: Voluptatem aut accusantium consequatur sit perferendis. 
2022/04/14 10:53:13 [storage 1970-01-01 03:30:00.002 +0330 +0330][duration 50.0605ms][timeout false]: Voluptatem consequatur aut sit perferendis accusantium. 
2022/04/14 10:53:13 [storage 1970-01-01 03:30:00.003 +0330 +0330][duration 53.646917ms][timeout false]: Perferendis accusantium consequatur sit voluptatem aut. 
2022/04/14 10:53:13 [storage 1970-01-01 03:30:00.004 +0330 +0330][duration 56.380917ms][timeout false]: Consequatur accusantium perferendis sit aut voluptatem. 
2022/04/14 10:53:13 [storage 1970-01-01 03:30:00.005 +0330 +0330][duration 59.531125ms][timeout false]: Aut voluptatem perferendis sit accusantium consequatur. 
2022/04/14 10:53:13 [storage 1970-01-01 03:30:00.006 +0330 +0330][duration 62.425875ms][timeout false]: Sit accusantium aut consequatur voluptatem perferendis. 
2022/04/14 10:53:13 [storage 1970-01-01 03:30:00.007 +0330 +0330][duration 65.155208ms][timeout false]: Perferendis aut sit accusantium voluptatem consequatur. 
2022/04/14 10:53:13 [storage 1970-01-01 03:30:00.008 +0330 +0330][duration 67.785292ms][timeout false]: Voluptatem accusantium aut consequatur sit perferendis. 
2022/04/14 10:53:13 [storage 1970-01-01 03:30:00.009 +0330 +0330][duration 69.869208ms][timeout false]: Accusantium voluptatem sit perferendis aut consequatur.