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(); }