ackintosh / ganesha

:elephant: A Circuit Breaker pattern implementation for PHP applications.
https://ackintosh.github.io/ganesha/
MIT License
585 stars 42 forks source link

Make the example more easily executable #4

Closed ackintosh closed 6 years ago

ackintosh commented 6 years ago

Setup

$ pwd
~/ganesha
$ composer install

Run

# Starts http and memcached server
$ docker-compose up
# Starts clients (with Ganesha) that repeats http reqeuest to server
# It is recommended to run 3 or more clients
$ docker-compose run --rm client sh -c bin/run_client

Monitor your circuit

$ brew install watch
$ watch docker-compose run --rm client php monitor.php

Every 2.0s: php monitor.php

[ settings ]
time window : 20s
failure rate : 10%
minumum requests : 10
interval to half open : 5s

[ failure rate ]
current  : 0 %
previous : 12.21 %