예제 #1
0
 public HystrixCollapserConfiguration(IHystrixCollapserKey collapserKey, int maxRequestsInBatch, int timerDelayInMilliseconds,
                                      bool requestCacheEnabled, CollapserMetricsConfig collapserMetricsConfig)
 {
     this.collapserKey             = collapserKey;
     this.maxRequestsInBatch       = maxRequestsInBatch;
     this.timerDelayInMilliseconds = timerDelayInMilliseconds;
     this.requestCacheEnabled      = requestCacheEnabled;
     this.collapserMetricsConfig   = collapserMetricsConfig;
 }
예제 #2
0
        public static HystrixCollapserConfiguration Sample(IHystrixCollapserKey collapserKey, IHystrixCollapserOptions collapserProperties)
        {
            CollapserMetricsConfig collapserMetricsConfig = new CollapserMetricsConfig(
                collapserProperties.MetricsRollingPercentileWindowBuckets,
                collapserProperties.MetricsRollingPercentileWindowInMilliseconds,
                collapserProperties.MetricsRollingPercentileEnabled,
                collapserProperties.MetricsRollingStatisticalWindowBuckets,
                collapserProperties.MetricsRollingStatisticalWindowInMilliseconds);

            return(new HystrixCollapserConfiguration(
                       collapserKey,
                       collapserProperties.MaxRequestsInBatch,
                       collapserProperties.TimerDelayInMilliseconds,
                       collapserProperties.RequestCacheEnabled,
                       collapserMetricsConfig));
        }