public override IHystrixCommandOptions GetCommandOptions(IHystrixCommandKey commandKey, IHystrixCommandOptions builder)
 {
     if (builder == null)
     {
         builder = HystrixCommandOptionsTest.GetUnitTestOptions();
     }
     return(builder);
 }
Пример #2
0
            private static HystrixCommandOptions GetUnitTestSettings(string commandKey)
            {
                HystrixCommandOptions opts = HystrixCommandOptionsTest.GetUnitTestOptions();

                opts.GroupKey   = HystrixCommandGroupKeyDefault.AsKey("Command");
                opts.CommandKey = HystrixCommandKeyDefault.AsKey(commandKey);
                opts.ExecutionTimeoutInMilliseconds       = 1000;
                opts.CircuitBreakerRequestVolumeThreshold = 20;
                return(opts);
            }
Пример #3
0
            protected static HystrixCommandOptions Options(string groupKey, string commandKey, int requestVolumeThreshold, int sleepWindow)
            {
                var opts = HystrixCommandOptionsTest.GetUnitTestOptions();

                opts.GroupKey   = HystrixCommandGroupKeyDefault.AsKey(groupKey);
                opts.CommandKey = HystrixCommandKeyDefault.AsKey(commandKey);
                opts.ExecutionTimeoutInMilliseconds          = 500;
                opts.CircuitBreakerRequestVolumeThreshold    = requestVolumeThreshold;
                opts.CircuitBreakerSleepWindowInMilliseconds = sleepWindow;
                return(opts);
            }
Пример #4
0
 public TestCircuitBreaker(IHystrixCommandKey commandKey)
 {
     metrics           = GetMetrics(commandKey, HystrixCommandOptionsTest.GetUnitTestOptions());
     forceShortCircuit = false;
 }
Пример #5
0
 public TestCircuitBreaker()
 {
     this.metrics      = HystrixCircuitBreakerTest.GetMetrics(HystrixCommandOptionsTest.GetUnitTestOptions());
     forceShortCircuit = false;
 }
Пример #6
0
 public TestCommandBuilder(ExecutionIsolationStrategy isolationStrategy)
 {
     this.CommandPropertiesDefaults = HystrixCommandOptionsTest.GetUnitTestOptions();
     this.CommandPropertiesDefaults.ExecutionIsolationStrategy = isolationStrategy;
 }