예제 #1
0
        public static HealthCountsStream GetInstance(IHystrixCommandKey commandKey, int numBuckets, int bucketSizeInMs)
        {
            var result = Streams.GetOrAddEx(commandKey.Name, (k) =>
            {
                var newStream = new HealthCountsStream(commandKey, numBuckets, bucketSizeInMs, HystrixCommandMetrics.AppendEventToBucket);
                newStream.StartCachingStreamValuesIfUnstarted();
                return(newStream);
            });

            return(result);
        }
예제 #2
0
        public static void RemoveByKey(IHystrixCommandKey key)
        {
            HealthCountsStream old = null;

            streams.TryRemove(key.Name, out old);
        }