Exemple #1
0
 public DynamicOwnerAndKeyTestCommand(HystrixCommandGroupKey owner, HystrixCommandKey key)
     : base(new TestCommandBuilder()
 {
     Owner          = owner,
     DependencyKey  = key,
     CircuitBreaker = null,
     Metrics        = null,
 })
 {
     // we specifically are NOT passing in a circuit breaker here so we test that it creates a new one correctly based on the dynamic key
 }
        public HystrixServoMetricsPublisherCommand(
            HystrixCommandKey commandKey,
            HystrixCommandGroupKey commandGroupKey,
            HystrixCommandMetrics metrics,
            IHystrixCircuitBreaker circuitBreaker,
            IHystrixCommandProperties properties)
        {
            this.commandKey      = commandKey;
            this.commandGroupKey = commandGroupKey;
            this.metrics         = metrics;
            this.circuitBreaker  = circuitBreaker;
            this.properties      = properties;

            this.servoInstanceTag = new BasicTag("instance", commandKey.Name);
            this.servoTypeTag     = new BasicTag("origin", "HystrixCommand");
        }
 private static IHystrixCircuitBreaker GetCircuitBreaker(HystrixCommandKey key, HystrixCommandGroupKey commandGroup, HystrixCommandMetrics metrics, HystrixCommandPropertiesSetter properties)
 {
     return new HystrixCircuitBreakerImpl(new MockingHystrixCommandProperties(properties), metrics);
 }
 public HystrixMetricsPublisherCommandDefault(HystrixCommandKey commandKey, HystrixCommandGroupKey commandGroupKey, HystrixCommandMetrics metrics, IHystrixCircuitBreaker circuitBreaker, IHystrixCommandProperties properties)
 {
     // do nothing by default
 }
 public virtual IHystrixMetricsPublisherCommand GetMetricsPublisherForCommand(HystrixCommandKey commandKey, HystrixCommandGroupKey commandGroupKey, HystrixCommandMetrics metrics, IHystrixCircuitBreaker circuitBreaker, IHystrixCommandProperties properties)
 {
     return new HystrixMetricsPublisherCommandDefault(commandKey, commandGroupKey, metrics, circuitBreaker, properties);
 }
 public IHystrixMetricsPublisherCommand GetPublisherForCommand(HystrixCommandKey commandKey, HystrixCommandGroupKey commandOwner, HystrixCommandMetrics metrics, IHystrixCircuitBreaker circuitBreaker, IHystrixCommandProperties properties)
 {
     return(this.commandPublishers.GetOrAdd(commandKey.Name,
                                            w => this.strategy.GetMetricsPublisherForCommand(commandKey, commandOwner, metrics, circuitBreaker, properties),
                                            w => w.Initialize()));
 }
 public static IHystrixMetricsPublisherCommand CreateOrRetrievePublisherForCommand(HystrixCommandKey commandKey, HystrixCommandGroupKey commandOwner, HystrixCommandMetrics metrics, IHystrixCircuitBreaker circuitBreaker, IHystrixCommandProperties properties)
 {
     return(instance.GetPublisherForCommand(commandKey, commandOwner, metrics, circuitBreaker, properties));
 }
 public virtual IHystrixMetricsPublisherCommand GetMetricsPublisherForCommand(HystrixCommandKey commandKey, HystrixCommandGroupKey commandGroupKey, HystrixCommandMetrics metrics, IHystrixCircuitBreaker circuitBreaker, IHystrixCommandProperties properties)
 {
     return(new HystrixMetricsPublisherCommandDefault(commandKey, commandGroupKey, metrics, circuitBreaker, properties));
 }
 public DynamicOwnerTestCommand(HystrixCommandGroupKey owner)
     : base(new TestCommandBuilder() { Owner = owner })
 {
 }
 public IHystrixMetricsPublisherCommand GetPublisherForCommand(HystrixCommandKey commandKey, HystrixCommandGroupKey commandOwner, HystrixCommandMetrics metrics, IHystrixCircuitBreaker circuitBreaker, IHystrixCommandProperties properties)
 {
     return this.commandPublishers.GetOrAdd(commandKey.Name,
         w => this.strategy.GetMetricsPublisherForCommand(commandKey, commandOwner, metrics, circuitBreaker, properties),
         w => w.Initialize());
 }
 public static IHystrixMetricsPublisherCommand CreateOrRetrievePublisherForCommand(HystrixCommandKey commandKey, HystrixCommandGroupKey commandOwner, HystrixCommandMetrics metrics, IHystrixCircuitBreaker circuitBreaker, IHystrixCommandProperties properties)
 {
     return instance.GetPublisherForCommand(commandKey, commandOwner, metrics, circuitBreaker, properties);
 }
 public static HystrixCommandSetter WithGroupKey(HystrixCommandGroupKey groupKey)
 {
     return new HystrixCommandSetter(groupKey);
 }
 public HystrixCommandSetter(HystrixCommandGroupKey groupKey)
 {
     this.groupKey = groupKey;
 }
 private static IHystrixCircuitBreaker GetCircuitBreaker(HystrixCommandKey key, HystrixCommandGroupKey commandGroup, HystrixCommandMetrics metrics, HystrixCommandPropertiesSetter properties)
 {
     return(new HystrixCircuitBreakerImpl(new MockingHystrixCommandProperties(properties), metrics));
 }