- Build the docker image:
docker build -t test/nats:latest .
- Install NATS cli: https://docs.nats.io/using-nats/nats-tools/nats_cli
- Run docker-compose (will start NATS, prometheus and 2 consumers):
docker-compose -f ./docker-compose.yaml up -d
- Start NATS benchmark:
nats bench updates --pub=4 --msgs 1000000000 --size=1000
- Wait a little and start the slow consumer:
docker run --rm -it --network=nats-test_default test/nats:latest python3 slow-consumer.py
- Open prometheus: http://localhost:9091/graph
- Insert query:
sum by (job) (rate(nats_varz_in_msgs[30s]))