Closed albertojgomez closed 5 years ago
Thanks for your PR! I'll have a look on this weekend. 😉
Thanks @ackintosh ! Much appreciated.
Question: How could we use our custom StrorageKeys
implementation? Typically an instance of Ganesha is built via Ganesha::Builder but I could not find the way that pass a StorageKeys.
https://github.com/ackintosh/ganesha/pull/48#issuecomment-526795336
I think it may be good that we can pass an instance of StorageKeysInterface implementation via Builder like below 💡 :
(the sample below is based on https://github.com/ackintosh/ganesha#rate-default )
$ganesha = Ackintosh\Ganesha\Builder::build([
// The interval in time (seconds) that evaluate the thresholds.
'timeWindow' => 30,
// The failure rate threshold in percentage that changes CircuitBreaker's state to `OPEN`.
'failureRateThreshold' => 50,
// The minimum number of requests to detect failures.
// Even if `failureRateThreshold` exceeds the threshold,
// CircuitBreaker remains in `CLOSED` if `minimumRequests` is below this threshold.
'minimumRequests' => 10,
// The interval (seconds) to change CircuitBreaker's state from `OPEN` to `HALF_OPEN`.
'intervalToHalfOpen' => 5,
// The storage adapter instance to store various statistics to detect failures.
'adapter' => new Ackintosh\Ganesha\Storage\Adapter\Memcached($memcached),
+ // If you want customize the keys to be used when storing circuit breaker information,
+ // set an instance of StorageKeysInterface implementation.
+ 'storageKeys' => new YourStorageKeys(),
]);
That is not required for this PR. 😌
So if making the builder parameter(storageKeys
) available is hard for you, the enhancement will be day2-requirement.
Hi @albertojgomez , I would appriciate it if you could check the comments. 😺
I still can't get your reply but have updated the PR because this enhancement is worth providing to users. Thank you for your understanding. ✨
This PR enables users to provide an object that contains the keys to be used when storing circuit breaker information