public HystrixPropertiesCommandDefault(HystrixCommandPropertiesSetter setter)
 {
     CircuitBreakerEnabled = HystrixPropertyFactory.AsProperty(setter.CircuitBreakerEnabled, DefaultCircuitBreakerEnabled);
     CircuitBreakerErrorThresholdPercentage = HystrixPropertyFactory.AsProperty(setter.CircuitBreakerErrorThresholdPercentage, DefaultCircuitBreakerErrorThresholdPercentage);
     CircuitBreakerForceClosed                        = HystrixPropertyFactory.AsProperty(setter.CircuitBreakerForceClosed, DefaultCircuitBreakerForceClosed);
     CircuitBreakerForceOpen                          = HystrixPropertyFactory.AsProperty(setter.CircuitBreakerForceOpen, DefaultCircuitBreakerForceOpen);
     CircuitBreakerRequestVolumeThreshold             = HystrixPropertyFactory.AsProperty(setter.CircuitBreakerRequestVolumeThreshold, DefaultCircuitBreakerRequestVolumeThreshold);
     CircuitBreakerSleepWindow                        = HystrixPropertyFactory.AsProperty(setter.CircuitBreakerSleepWindow, DefaultCircuitBreakerSleepWindow);
     ExecutionIsolationSemaphoreMaxConcurrentRequests = HystrixPropertyFactory.AsProperty(setter.ExecutionIsolationSemaphoreMaxConcurrentRequests, DefaultExecutionIsolationSemaphoreMaxConcurrentRequests);
     ExecutionIsolationStrategy                       = HystrixPropertyFactory.AsProperty(setter.ExecutionIsolationStrategy, DefaultExecutionIsolationStrategy);
     ExecutionIsolationThreadInterruptOnTimeout       = HystrixPropertyFactory.AsProperty(setter.ExecutionIsolationThreadInterruptOnTimeout, DefaultExecutionIsolationThreadInterruptOnTimeout);
     ExecutionIsolationThreadPoolKeyOverride          = HystrixPropertyFactory.AsProperty <string>((string)null);
     ExecutionIsolationThreadTimeout                  = HystrixPropertyFactory.AsProperty(setter.ExecutionIsolationThreadTimeout, DefaultExecutionIsolationThreadTimeout);
     FallbackIsolationSemaphoreMaxConcurrentRequests  = HystrixPropertyFactory.AsProperty(setter.FallbackIsolationSemaphoreMaxConcurrentRequests, DefaultFallbackIsolationSemaphoreMaxConcurrentRequests);
     FallbackEnabled = HystrixPropertyFactory.AsProperty(setter.FallbackEnabled, DefaultFallbackEnabled);
     MetricsHealthSnapshotInterval                 = HystrixPropertyFactory.AsProperty(setter.MetricsHealthSnapshotInterval, DefaultMetricsHealthSnapshotInterval);
     MetricsRollingPercentileBucketSize            = HystrixPropertyFactory.AsProperty(setter.MetricsRollingPercentileBucketSize, DefaultMetricsRollingPercentileBucketSize);
     MetricsRollingPercentileEnabled               = HystrixPropertyFactory.AsProperty(setter.MetricsRollingPercentileEnabled, DefaultMetricsRollingPercentileEnabled);
     MetricsRollingPercentileWindowInMilliseconds  = HystrixPropertyFactory.AsProperty(setter.MetricsRollingPercentileWindowInMilliseconds, DefaultMetricsRollingPercentileWindowInMilliseconds);
     MetricsRollingPercentileWindowBuckets         = HystrixPropertyFactory.AsProperty(setter.MetricsRollingPercentileWindowBuckets, DefaultMetricsRollingPercentileWindowBuckets);
     MetricsRollingStatisticalWindowInMilliseconds = HystrixPropertyFactory.AsProperty(setter.MetricsRollingStatisticalWindowInMilliseconds, DefaultMetricsRollingStatisticalWindowInMilliseconds);
     MetricsRollingStatisticalWindowBuckets        = HystrixPropertyFactory.AsProperty(setter.MetricsRollingStatisticalWindowBuckets, DefaultMetricsRollingStatisticalWindowBuckets);
     RequestCacheEnabled = HystrixPropertyFactory.AsProperty(setter.RequestCacheEnabled, DefaultRequestCacheEnabled);
     RequestLogEnabled   = HystrixPropertyFactory.AsProperty(setter.RequestLogEnabled, DefaultRequestLogEnabled);
 }
示例#2
0
        public void PropertyFactory_Nested2()
        {
            IHystrixProperty <string> nullValue = HystrixPropertyFactory.NullProperty <string>();

            IHystrixProperty <string> withDefault = HystrixPropertyFactory.AsProperty(nullValue, "b");

            Assert.AreEqual("b", withDefault.Get());
        }
示例#3
0
        public void PropertyFactory_Series2()
        {
            IHystrixProperty <string> nullValue = HystrixPropertyFactory.NullProperty <string>();
            IHystrixProperty <string> a         = HystrixPropertyFactory.AsProperty(nullValue, (string)null);

            IHystrixProperty <string> withDefault = HystrixPropertyFactory.AsProperty(a, nullValue, HystrixPropertyFactory.AsProperty("b"), nullValue, HystrixPropertyFactory.AsProperty("c"));

            Assert.AreEqual("b", withDefault.Get());
        }
示例#4
0
        public void PropertyFactory_Nested1()
        {
            IHystrixProperty <string> a = HystrixPropertyFactory.AsProperty("a");

            Assert.AreEqual("a", a.Get());

            IHystrixProperty <string> aWithDefault = HystrixPropertyFactory.AsProperty(a, "b");

            Assert.AreEqual("a", aWithDefault.Get());
        }
示例#5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HystrixThreadPoolPropertiesDefault"/> class.
        /// </summary>
        /// <param name="setter">The property value provider.</param>
        public HystrixThreadPoolPropertiesDefault(HystrixThreadPoolPropertiesSetter setter)
        {
            if (setter == null)
            {
                throw new ArgumentNullException("setter");
            }

            this.CoreSize      = HystrixPropertyFactory.AsProperty(setter.CoreSize, DefaultCoreSize);
            this.KeepAliveTime = HystrixPropertyFactory.AsProperty(setter.KeepAliveTime, DefaultKeepAliveTime);
            this.MaxQueueSize  = HystrixPropertyFactory.AsProperty(setter.MaxQueueSize, DefaultMaxQueueSize);
            this.QueueSizeRejectionThreshold = HystrixPropertyFactory.AsProperty(setter.QueueSizeRejectionThreshold, DefaultQueueSizeRejectionThreshold);
            this.MetricsRollingStatisticalWindowInMilliseconds = HystrixPropertyFactory.AsProperty(setter.MetricsRollingStatisticalWindowInMilliseconds, DefaultMetricsRollingStatisticalWindowInMilliseconds);
            this.MetricsRollingStatisticalWindowBuckets        = HystrixPropertyFactory.AsProperty(setter.MetricsRollingStatisticalWindowBuckets, DefaultThreadPoolRollingNumberStatisticalWindowBuckets);
        }
 public HystrixPropertiesCommandDefault(HystrixCommandPropertiesSetter setter)
 {
     CircuitBreakerEnabled = HystrixPropertyFactory.AsProperty(setter.CircuitBreakerEnabled, DefaultCircuitBreakerEnabled);
     CircuitBreakerErrorThresholdPercentage = HystrixPropertyFactory.AsProperty(setter.CircuitBreakerErrorThresholdPercentage, DefaultCircuitBreakerErrorThresholdPercentage);
     // dynamic property can be updated at runtime
     CircuitBreakerForceClosed = HystrixPropertyFactory.AsDynamicProperty(setter.CircuitBreakerForceClosed, DefaultCircuitBreakerForceClosed);
     // dynamic property can be updated at runtime
     CircuitBreakerForceOpen = HystrixPropertyFactory.AsDynamicProperty(setter.CircuitBreakerForceOpen, DefaultCircuitBreakerForceOpen);
     CircuitBreakerRequestVolumeThreshold = HystrixPropertyFactory.AsProperty(setter.CircuitBreakerRequestVolumeThreshold, DefaultCircuitBreakerRequestVolumeThreshold);
     CircuitBreakerSleepWindow            = HystrixPropertyFactory.AsProperty(setter.CircuitBreakerSleepWindow, DefaultCircuitBreakerSleepWindow);
     // dynamic property can be updated at runtime
     ExecutionIsolationThreadTimeout = HystrixPropertyFactory.AsDynamicProperty(setter.ExecutionIsolationThreadTimeout);
     MetricsHealthSnapshotInterval   = HystrixPropertyFactory.AsProperty(setter.MetricsHealthSnapshotInterval, DefaultMetricsHealthSnapshotInterval);
     MetricsRollingStatisticalWindowInMilliseconds = HystrixPropertyFactory.AsProperty(setter.MetricsRollingStatisticalWindowInMilliseconds, DefaultMetricsRollingStatisticalWindowInMilliseconds);
     MetricsRollingStatisticalWindowBuckets        = HystrixPropertyFactory.AsProperty(setter.MetricsRollingStatisticalWindowBuckets, DefaultMetricsRollingStatisticalWindowBuckets);
     MetricsIntegerBufferTimeWindowInSeconds       = HystrixPropertyFactory.AsProperty(setter.MetricsIntegerBufferTimeWindowInSeconds, DefaultMetricsIntegerBufferTimeWindowInSeconds);
     MetricsIntegerBufferBucketTimeWindowInSeconds = HystrixPropertyFactory.AsProperty(setter.MetricsIntegerBufferBucketTimeWindowInSeconds, DefaultMetricsIntegerBufferBucketTimeWindowInSeconds);
     MetricsIntegerBufferBucketSizeLimit           = HystrixPropertyFactory.AsProperty(setter.MetricsIntegerBufferBucketSizeLimit, DefaultMetricsIntegerBufferBucketSizeLimit);
     RequestLogEnabled = HystrixPropertyFactory.AsProperty(setter.RequestLogEnabled, DefaultRequestLogEnabled);
 }
示例#7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HystrixRollingNumber"/> class. This constructor is used for unit testing
 /// to be able to inject mocked time measurement.
 /// </summary>
 /// <param name="time">The <see cref="ITime"/> instance to measure time.</param>
 /// <param name="timeInMilliseconds">The total time window to track.</param>
 /// <param name="numberOfBuckets">The number of parts to break the time window.</param>
 internal HystrixRollingNumber(ITime time, int timeInMilliseconds, int numberOfBuckets)
     : this(time, HystrixPropertyFactory.AsProperty(timeInMilliseconds), HystrixPropertyFactory.AsProperty(numberOfBuckets))
 {
 }
示例#8
0
 public HystrixPropertiesCollapserDefault(HystrixCollapserPropertiesSetter setter)
 {
     RequestCachingEnabled = HystrixPropertyFactory.AsProperty(setter.RequestCacheEnabled, DefaultRequestCacheEnabled);
     MaxRequestsInBatch    = HystrixPropertyFactory.AsProperty(setter.MaxRequestsInBatch, DefaultMaxRequestsInBatch);
     TimerDelay            = HystrixPropertyFactory.AsProperty(setter.TimerDelay, DefaultTimerDelay);
 }