public IHystrixMetricsPublisherThreadPool GetPublisherForThreadPool(HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolMetrics metrics, IHystrixThreadPoolProperties properties)
 {
     return(this.threadPoolPublishers.GetOrAdd(threadPoolKey.Name,
                                               w => this.strategy.GetMetricsPublisherForThreadPool(threadPoolKey, metrics, properties),
                                               w => w.Initialize()));
 }
Exemplo n.º 2
0
 public HystrixMetricsPublisherThreadPoolContainer(HystrixThreadPoolMetrics hystrixThreadPoolMetrics)
 {
     HystrixThreadPoolMetrics = hystrixThreadPoolMetrics;
 }
Exemplo n.º 3
0
        //private static final DynamicIntProperty dataEmissionIntervalInMs =
        //    DynamicPropertyFactory.getInstance().getIntProperty("hystrix.stream.dashboard.intervalInMilliseconds", 500);
        // TODO:

        private HystrixDashboardStream(int delayInMs)
        {
            this.delayInMs    = delayInMs;
            this.singleSource = Observable.Interval(TimeSpan.FromMilliseconds(delayInMs))
                                .Map((timestamp) => { return(new DashboardData(HystrixCommandMetrics.GetInstances(), HystrixThreadPoolMetrics.GetInstances(), HystrixCollapserMetrics.GetInstances())); })
                                .OnSubscribe(() => { isSourceCurrentlySubscribed.Value = true; })
                                .OnDispose(() => { isSourceCurrentlySubscribed.Value = false; })
                                .Publish().RefCount();
            //.onBackpressureDrop();
        }
 public static IHystrixMetricsPublisherThreadPool CreateOrRetrievePublisherForThreadPool(HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolMetrics metrics, IHystrixThreadPoolProperties properties)
 {
     return(instance.GetPublisherForThreadPool(threadPoolKey, metrics, properties));
 }
 public virtual IHystrixMetricsPublisherThreadPool GetMetricsPublisherForThreadPool(IHystrixThreadPoolKey threadPoolKey, HystrixThreadPoolMetrics metrics, IHystrixThreadPoolOptions properties)
 {
     return(new HystrixMetricsPublisherThreadPoolDefault(threadPoolKey, metrics, properties));
 }
 public override IHystrixMetricsPublisherThreadPool GetMetricsPublisherForThreadPool(IHystrixThreadPoolKey threadPoolKey, HystrixThreadPoolMetrics metrics, IHystrixThreadPoolOptions properties)
 {
     return(new HystrixMetricsPublisherThreadPoolContainer(metrics));
 }
Exemplo n.º 7
0
 internal IHystrixMetricsPublisherThreadPool GetPublisherForThreadPool(IHystrixThreadPoolKey threadPoolKey, HystrixThreadPoolMetrics metrics, IHystrixThreadPoolOptions properties)
 {
     return(ThreadPoolPublishers.GetOrAddEx(threadPoolKey.Name, (k) =>
     {
         IHystrixMetricsPublisherThreadPool publisher = HystrixPlugins.MetricsPublisher.GetMetricsPublisherForThreadPool(threadPoolKey, metrics, properties);
         publisher.Initialize();
         return publisher;
     }));
 }
 public HystrixThreadPoolMetricsTest(ITestOutputHelper output)
     : base()
 {
     this.output = output;
     HystrixThreadPoolMetrics.Reset();
 }
Exemplo n.º 9
0
 public static IHystrixMetricsPublisherThreadPool CreateOrRetrievePublisherForThreadPool(IHystrixThreadPoolKey threadPoolKey, HystrixThreadPoolMetrics metrics, IHystrixThreadPoolOptions properties)
 {
     return(singleton.GetPublisherForThreadPool(threadPoolKey, metrics, properties));
 }
Exemplo n.º 10
0
 private static HystrixThreadPoolUtilization SampleThreadPoolUtilization(HystrixThreadPoolMetrics threadPoolMetrics)
 {
     return(HystrixThreadPoolUtilization.Sample(threadPoolMetrics));
 }
Exemplo n.º 11
0
 public override IHystrixMetricsPublisherThreadPool GetMetricsPublisherForThreadPool(IHystrixThreadPoolKey threadPoolKey, HystrixThreadPoolMetrics metrics, IHystrixThreadPoolOptions properties)
 {
     return(new MyHystrixMetricsPublisherThreadPool(ThreadCounter));
 }
 public IHystrixMetricsPublisherThreadPool GetMetricsPublisherForThreadPool(HystrixThreadPoolKey threadPoolKey, HystrixThreadPoolMetrics metrics, IHystrixThreadPoolProperties properties)
 {
     return(new HystrixDelegateMetricsPublisherThreadPool(() => this.threadCounter.IncrementAndGet()));
 }
 public HystrixMetricsPublisherThreadPoolDefault(IHystrixThreadPoolKey threadPoolKey, HystrixThreadPoolMetrics metrics, IHystrixThreadPoolOptions properties)
 {
     // do nothing by default
 }