public class TenacityPropertyStore {
private TenacityPropertyStore() {}
public static TenacityConfiguration getTenacityConfiguration(TenacityPropertyKey key) {
final HystrixCommandProperties commandProperties = TenacityCommand.getCommandProperties(key);
final HystrixThreadPoolProperties threadPoolProperties = TenacityCommand.getThreadpoolProperties(key);
return new TenacityConfiguration(
new ThreadPoolConfiguration(
threadPoolProperties.coreSize().get(),
threadPoolProperties.keepAliveTimeMinutes().get(),
threadPoolProperties.maxQueueSize().get(),
threadPoolProperties.queueSizeRejectionThreshold().get(),
threadPoolProperties.metricsRollingStatisticalWindowInMilliseconds().get(),
threadPoolProperties.metricsRollingStatisticalWindowBuckets().get()),
new CircuitBreakerConfiguration(
commandProperties.circuitBreakerRequestVolumeThreshold().get(),
commandProperties.circuitBreakerSleepWindowInMilliseconds().get(),
commandProperties.circuitBreakerErrorThresholdPercentage().get(),
commandProperties.metricsRollingStatisticalWindowInMilliseconds().get(),