Exemplo n.º 1
0
        internal HystrixCommandMetrics(string opName, string serviceName, string fullServiceName, string metricPrefix, IHystrixCommandProperties properties)
        {
            this.serviceName     = serviceName;
            this.opName          = opName;
            this.properties      = properties;
            this.fullServiceName = fullServiceName;
            this.counter         = new HystrixRollingNumber(properties.MetricsRollingStatisticalWindowInMilliseconds, properties.MetricsRollingStatisticalWindowBuckets);

            this.successCounter            = new LongAdder();
            this.frameworkErrorCounter     = new LongAdder();
            this.validationErrorCounter    = new LongAdder();
            this.serviceErrorCounter       = new LongAdder();
            this.shortCircuitCounter       = new LongAdder();
            this.threadPoolRejectedCounter = new LongAdder();
            this.timeoutCounter            = new LongAdder();

            int timeWindowInSeconds       = properties.MetricsIntegerBufferTimeWindowInSeconds.Get();
            int bucketTimeWindowInSeconds = properties.MetricsIntegerBufferBucketTimeWindowInSeconds.Get();
            int bucketSizeLimit           = properties.MetricsIntegerBufferBucketSizeLimit.Get();

            this.executionOperationLatencyBuffer = new HystrixIntegerCircularBuffer(timeWindowInSeconds, bucketTimeWindowInSeconds, bucketSizeLimit);
            this.requestLatencyBuffer            = new HystrixIntegerCircularBuffer(timeWindowInSeconds, bucketTimeWindowInSeconds, bucketSizeLimit);

            MetricNameEventDistribution        = metricPrefix + ".event.distribution";
            MetricNameConcurrentExecutionCount = metricPrefix + ".execution.concurrency";
            MetricNameRequestCount             = metricPrefix + ".request.count";
            MetricNameLatency             = metricPrefix + ".request.latency";
            MetricNameLatencyDistribution = metricPrefix + ".request.latency.distribution";
            MetricNameLatencyPercentile   = metricPrefix + ".request.latency.percentile";
        }
 internal HystrixCommandMetrics(HystrixCommandKey key, HystrixCommandGroupKey commandGroup, IHystrixCommandProperties properties, IHystrixEventNotifier eventNotifier)
 {
     this.key                 = key;
     this.group               = commandGroup;
     this.properties          = properties;
     this.counter             = new HystrixRollingNumber(properties.MetricsRollingStatisticalWindowInMilliseconds, properties.MetricsRollingStatisticalWindowBuckets);
     this.percentileExecution = new HystrixRollingPercentile(properties.MetricsRollingPercentileWindowInMilliseconds, properties.MetricsRollingPercentileWindowBuckets, properties.MetricsRollingPercentileBucketSize, properties.MetricsRollingPercentileEnabled);
     this.percentileTotal     = new HystrixRollingPercentile(properties.MetricsRollingPercentileWindowInMilliseconds, properties.MetricsRollingPercentileWindowBuckets, properties.MetricsRollingPercentileBucketSize, properties.MetricsRollingPercentileEnabled);
     this.eventNotifier       = eventNotifier;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="HystrixCircuitBreakerImpl"/> class.
        /// </summary>
        /// <param name="properties">The properties of the owner command.</param>
        /// <param name="metrics">The metrics of the owner command.</param>
        public HystrixCircuitBreakerImpl(IHystrixCommandProperties properties, HystrixCommandMetrics metrics)
        {
            if (properties == null)
            {
                throw new ArgumentNullException("properties");
            }

            if (metrics == null)
            {
                throw new ArgumentNullException("metrics");
            }

            this.properties = properties;
            this.metrics = metrics;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="HystrixCircuitBreakerImpl"/> class.
        /// </summary>
        /// <param name="properties">The properties of the owner command.</param>
        /// <param name="metrics">The metrics of the owner command.</param>
        public HystrixCircuitBreakerImpl(IHystrixCommandProperties properties, HystrixCommandMetrics metrics)
        {
            if (properties == null)
            {
                throw new ArgumentNullException("properties");
            }

            if (metrics == null)
            {
                throw new ArgumentNullException("metrics");
            }

            this.properties = properties;
            this.metrics    = metrics;
        }
        public HystrixServoMetricsPublisherCommand(
            HystrixCommandKey commandKey,
            HystrixCommandGroupKey commandGroupKey,
            HystrixCommandMetrics metrics,
            IHystrixCircuitBreaker circuitBreaker,
            IHystrixCommandProperties properties)
        {
            this.commandKey      = commandKey;
            this.commandGroupKey = commandGroupKey;
            this.metrics         = metrics;
            this.circuitBreaker  = circuitBreaker;
            this.properties      = properties;

            this.servoInstanceTag = new BasicTag("instance", commandKey.Name);
            this.servoTypeTag     = new BasicTag("origin", "HystrixCommand");
        }
Exemplo n.º 6
0
        public HystrixCommand(string servicePath, string opName, string serviceName, string fullServiceName, string metricPrefix /*"soa.service"*/, HystrixCommandPropertiesSetter commandPropertiesDefaults)
        {
            // op name & service name initialization
            if (opName == null)
            {
                throw new ArgumentNullException("opName");
            }
            if (serviceName == null)
            {
                throw new ArgumentNullException("serviceName");
            }
            if (metricPrefix == null)
            {
                throw new ArgumentNullException("metricPrefix");
            }
            if (fullServiceName == null)
            {
                throw new ArgumentNullException("fullServiceName");
            }

            CommandKey = servicePath + "." + opName;

            // Properties initialization commandPropertiesDefaults 只设置了 电容器的开关和方法的执行timeout 2个参数
            this.properties = HystrixPropertiesFactory.GetCommandProperties(CommandKey, commandPropertiesDefaults);

            // Metrics initializtion
            this.metrics = HystrixCommandMetrics.GetInstance(CommandKey, opName, serviceName, fullServiceName, metricPrefix, this.properties);

            // CircuitBreaker initializtion
            if (this.properties.CircuitBreakerEnabled.Get())
            {
                this.circuitBreaker = HystrixCircuitBreakerFactory.GetInstance(CommandKey, this.properties, this.metrics);
            }
            else
            {
                this.circuitBreaker = new NoOpCircuitBreaker();
            }
        }
 public static HystrixCommandMetrics GetInstance(HystrixCommandKey key, HystrixCommandGroupKey commandGroup, IHystrixCommandProperties properties)
 {
     return(metrics.GetOrAdd(key.Name, w => new HystrixCommandMetrics(key, commandGroup, properties, HystrixPlugins.Instance.EventNotifier)));
 }
Exemplo n.º 8
0
 public static HystrixCommandMetrics GetInstance(string commandKey, string opName, string serviceName, string fullServiceName, string metricPrefix, IHystrixCommandProperties properties)
 {
     return(metrics.GetOrAdd(commandKey, key => new HystrixCommandMetrics(opName, serviceName, fullServiceName, metricPrefix, properties)));
 }
 public virtual IHystrixMetricsPublisherCommand GetMetricsPublisherForCommand(HystrixCommandKey commandKey, HystrixCommandGroupKey commandGroupKey, HystrixCommandMetrics metrics, IHystrixCircuitBreaker circuitBreaker, IHystrixCommandProperties properties)
 {
     return new HystrixMetricsPublisherCommandDefault(commandKey, commandGroupKey, metrics, circuitBreaker, properties);
 }
 public HystrixMetricsPublisherCommandDefault(HystrixCommandKey commandKey, HystrixCommandGroupKey commandGroupKey, HystrixCommandMetrics metrics, IHystrixCircuitBreaker circuitBreaker, IHystrixCommandProperties properties)
 {
     // do nothing by default
 }
Exemplo n.º 11
0
 /// <summary>
 /// Gets the <see cref="IHystrixCircuitBreaker"/> instance for a given <see cref="HystrixCommandKey"/>.
 /// If no circuit breaker exists for the specified command key, a new one will be created using the properties and metrics parameters.
 /// If a circuit breaker already exists, those parameters will be ignored.
 /// </summary>
 /// <param name="commandKey">Command key of command instance requesting the circuit breaker.</param>
 /// <param name="properties">The properties of the specified command.</param>
 /// <param name="metrics">The metrics of the specified command.</param>
 /// <returns>A new or an existing circuit breaker instance.</returns>
 public static IHystrixCircuitBreaker GetInstance(HystrixCommandKey commandKey, IHystrixCommandProperties properties, HystrixCommandMetrics metrics)
 {
     return(Instances.GetOrAdd(commandKey, w => new HystrixCircuitBreakerImpl(properties, metrics)));
 }
        private static List <GlobalStreamHystrixCommandInfo> GetHystrixCommandInfoList()
        {
            var result = new List <GlobalStreamHystrixCommandInfo>();

            foreach (ServiceMetadata metadata in EndpointHost.Config.MetadataMap.Values)
            {
                string refinedServiceName = ServiceUtils.RefineServiceName(metadata.ServiceNamespace, metadata.ServiceName);
                foreach (Operation operation in metadata.Operations)
                {
                    HystrixCommandMetrics     commandMetrics    = operation.HystrixCommand.Metrics;
                    IHystrixCircuitBreaker    circuitBreaker    = operation.HystrixCommand.CircuitBreaker;
                    HealthCounts              healthCounts      = commandMetrics.GetHealthCounts();
                    IHystrixCommandProperties commandProperties = commandMetrics.Properties;

                    GlobalStreamHystrixCommandInfo hystrixCommandInfo = new GlobalStreamHystrixCommandInfo()
                    {
                        type                           = TurbineDataTypeHystrixCommand,
                        name                           = refinedServiceName + "." + operation.Name.ToLower(),
                        group                          = refinedServiceName,
                        currentTime                    = DateTime.Now.ToUnixTimeMs(),
                        isCircuitBreakerOpen           = circuitBreaker.IsOpen(),
                        errorPercentage                = healthCounts.ErrorPercentage,
                        errorCount                     = healthCounts.TotalErrorCount,
                        requestCount                   = healthCounts.TotalRequests,
                        rollingCountExceptionsThrown   = healthCounts.TotalExceptionCount,
                        rollingCountFailure            = healthCounts.TotalFailureCount,
                        rollingCountSemaphoreRejected  = 0,
                        rollingCountShortCircuited     = healthCounts.ShortCircuitedCount,
                        rollingCountSuccess            = healthCounts.SuccessCount,
                        rollingCountThreadPoolRejected = 0,
                        rollingCountTimeout            = healthCounts.TimeoutCount,
                        rollingCountFallbackFailure    = 0,
                        rollingCountFallbackSuccess    = 0,
                        rollingCountFallbackRejection  = 0,
                        latencyExecute                 = new GlobalStreamPercentileInfo()
                        {
                            P0      = commandMetrics.GetServiceExecutionTimePercentile(0),
                            P25     = commandMetrics.GetServiceExecutionTimePercentile(25),
                            P50     = commandMetrics.GetServiceExecutionTimePercentile(50),
                            P75     = commandMetrics.GetServiceExecutionTimePercentile(75),
                            P90     = commandMetrics.GetServiceExecutionTimePercentile(90),
                            P95     = commandMetrics.GetServiceExecutionTimePercentile(95),
                            P99     = commandMetrics.GetServiceExecutionTimePercentile(99),
                            P99DOT5 = commandMetrics.GetServiceExecutionTimePercentile(99.5),
                            P100    = commandMetrics.GetServiceExecutionTimePercentile(100)
                        },
                        latencyExecute_mean = commandMetrics.GetServiceExecutionTimeMean(),
                        latencyTotal        = new GlobalStreamPercentileInfo()
                        {
                            P0      = commandMetrics.GetTotalTimePercentile(0),
                            P25     = commandMetrics.GetTotalTimePercentile(25),
                            P50     = commandMetrics.GetTotalTimePercentile(50),
                            P75     = commandMetrics.GetTotalTimePercentile(75),
                            P90     = commandMetrics.GetTotalTimePercentile(90),
                            P95     = commandMetrics.GetTotalTimePercentile(95),
                            P99     = commandMetrics.GetTotalTimePercentile(99),
                            P99DOT5 = commandMetrics.GetTotalTimePercentile(99.5),
                            P100    = commandMetrics.GetTotalTimePercentile(100)
                        },
                        latencyTotal_mean = commandMetrics.GetTotalTimeMean(),
                        reportingHosts    = 1,
                        propertyValue_circuitBreakerEnabled = commandProperties.CircuitBreakerEnabled.Get(),
                        propertyValue_circuitBreakerErrorThresholdPercentage = commandProperties.CircuitBreakerErrorThresholdPercentage.Get(),
                        propertyValue_circuitBreakerForceClosed                        = commandProperties.CircuitBreakerForceClosed.Get(),
                        propertyValue_circuitBreakerForceOpen                          = commandProperties.CircuitBreakerForceOpen.Get(),
                        propertyValue_circuitBreakerRequestVolumeThreshold             = commandProperties.CircuitBreakerRequestVolumeThreshold.Get(),
                        propertyValue_circuitBreakerSleepWindowInMilliseconds          = (int)commandProperties.CircuitBreakerSleepWindow.Get().TotalMilliseconds,
                        propertyValue_executionIsolationSemaphoreMaxConcurrentRequests = 1000,
                        propertyValue_executionIsolationStrategy                       = TurbineStrategySemaphore,
                        propertyValue_executionIsolationThreadTimeoutInMilliseconds    = (int)operation.HystrixCommand.GetExecutionTimeout().TotalMilliseconds,
                        propertyValue_fallbackIsolationSemaphoreMaxConcurrentRequests  = 0,
                        propertyValue_metricsRollingStatisticalWindowInMilliseconds    = commandProperties.MetricsRollingStatisticalWindowInMilliseconds.Get(),
                        currentConcurrentExecutionCount = commandMetrics.CurrentConcurrentExecutionCount
                    };

                    result.Add(hystrixCommandInfo);
                }
            }

            return(result);
        }
 public IHystrixMetricsPublisherCommand GetPublisherForCommand(HystrixCommandKey commandKey, HystrixCommandGroupKey commandOwner, HystrixCommandMetrics metrics, IHystrixCircuitBreaker circuitBreaker, IHystrixCommandProperties properties)
 {
     return(this.commandPublishers.GetOrAdd(commandKey.Name,
                                            w => this.strategy.GetMetricsPublisherForCommand(commandKey, commandOwner, metrics, circuitBreaker, properties),
                                            w => w.Initialize()));
 }
Exemplo n.º 14
0
        /// <summary>
        /// Produces JSON formatted metrics data from an instance of <see cref="HystrixCommandMetrics"/>.
        /// </summary>
        /// <param name="commandMetrics">The metrics of a command.</param>
        /// <returns>JSON formatted metrics data.</returns>
        private static string CreateCommandSampleData(HystrixCommandMetrics commandMetrics)
        {
            IHystrixCircuitBreaker    circuitBreaker    = HystrixCircuitBreakerFactory.GetInstance(commandMetrics.CommandKey);
            HealthCounts              healthCounts      = commandMetrics.GetHealthCounts();
            IHystrixCommandProperties commandProperties = commandMetrics.Properties;

            JObject data = new JObject(
                new JProperty("type", "HystrixCommand"),
                new JProperty("name", commandMetrics.CommandKey.Name),
                new JProperty("group", commandMetrics.CommandGroup.Name),
                new JProperty("currentTime", GetCurrentTimeForJavascript()),
                circuitBreaker == null ? new JProperty("isCircuitBreakerOpen", false) : new JProperty("isCircuitBreakerOpen", circuitBreaker.IsOpen()),
                new JProperty("errorPercentage", healthCounts.ErrorPercentage), // health counts
                new JProperty("errorCount", healthCounts.ErrorCount),
                new JProperty("requestCount", healthCounts.TotalRequests),
                new JProperty("rollingCountCollapsedRequests", commandMetrics.GetRollingCount(HystrixRollingNumberEvent.Collapsed)), // rolling counters
                new JProperty("rollingCountExceptionsThrown", commandMetrics.GetRollingCount(HystrixRollingNumberEvent.ExceptionThrown)),
                new JProperty("rollingCountFailure", commandMetrics.GetRollingCount(HystrixRollingNumberEvent.Failure)),
                new JProperty("rollingCountFallbackFailure", commandMetrics.GetRollingCount(HystrixRollingNumberEvent.FallbackFailure)),
                new JProperty("rollingCountFallbackRejection", commandMetrics.GetRollingCount(HystrixRollingNumberEvent.FallbackRejection)),
                new JProperty("rollingCountFallbackSuccess", commandMetrics.GetRollingCount(HystrixRollingNumberEvent.FallbackSuccess)),
                new JProperty("rollingCountResponsesFromCache", commandMetrics.GetRollingCount(HystrixRollingNumberEvent.ResponseFromCache)),
                new JProperty("rollingCountSemaphoreRejected", commandMetrics.GetRollingCount(HystrixRollingNumberEvent.SemaphoreRejected)),
                new JProperty("rollingCountShortCircuited", commandMetrics.GetRollingCount(HystrixRollingNumberEvent.ShortCircuited)),
                new JProperty("rollingCountSuccess", commandMetrics.GetRollingCount(HystrixRollingNumberEvent.Success)),
                new JProperty("rollingCountThreadPoolRejected", commandMetrics.GetRollingCount(HystrixRollingNumberEvent.ThreadPoolRejected)),
                new JProperty("rollingCountTimeout", commandMetrics.GetRollingCount(HystrixRollingNumberEvent.Timeout)),
                new JProperty("currentConcurrentExecutionCount", commandMetrics.CurrentConcurrentExecutionCount),
                new JProperty("latencyExecute_mean", commandMetrics.GetExecutionTimeMean()), // latency percentiles
                new JProperty(
                    "latencyExecute",
                    new JObject(
                        new JProperty("0", commandMetrics.GetExecutionTimePercentile(0)),
                        new JProperty("25", commandMetrics.GetExecutionTimePercentile(25)),
                        new JProperty("50", commandMetrics.GetExecutionTimePercentile(50)),
                        new JProperty("75", commandMetrics.GetExecutionTimePercentile(75)),
                        new JProperty("90", commandMetrics.GetExecutionTimePercentile(90)),
                        new JProperty("95", commandMetrics.GetExecutionTimePercentile(95)),
                        new JProperty("99", commandMetrics.GetExecutionTimePercentile(99)),
                        new JProperty("99.5", commandMetrics.GetExecutionTimePercentile(99.5)),
                        new JProperty("100", commandMetrics.GetExecutionTimePercentile(100)))),
                new JProperty("latencyTotal_mean", commandMetrics.GetTotalTimeMean()),
                new JProperty(
                    "latencyTotal",
                    new JObject(
                        new JProperty("0", commandMetrics.GetTotalTimePercentile(0)),
                        new JProperty("25", commandMetrics.GetTotalTimePercentile(25)),
                        new JProperty("50", commandMetrics.GetTotalTimePercentile(50)),
                        new JProperty("75", commandMetrics.GetTotalTimePercentile(75)),
                        new JProperty("90", commandMetrics.GetTotalTimePercentile(90)),
                        new JProperty("95", commandMetrics.GetTotalTimePercentile(95)),
                        new JProperty("99", commandMetrics.GetTotalTimePercentile(99)),
                        new JProperty("99.5", commandMetrics.GetTotalTimePercentile(99.5)),
                        new JProperty("100", commandMetrics.GetTotalTimePercentile(100)))),
                new JProperty("propertyValue_circuitBreakerRequestVolumeThreshold", commandProperties.CircuitBreakerRequestVolumeThreshold.Get()), // property values for reporting what is actually seen by the command rather than what was set somewhere
                new JProperty("propertyValue_circuitBreakerSleepWindowInMilliseconds", (long)commandProperties.CircuitBreakerSleepWindow.Get().TotalMilliseconds),
                new JProperty("propertyValue_circuitBreakerErrorThresholdPercentage", commandProperties.CircuitBreakerErrorThresholdPercentage.Get()),
                new JProperty("propertyValue_circuitBreakerForceOpen", commandProperties.CircuitBreakerForceOpen.Get()),
                new JProperty("propertyValue_circuitBreakerForceClosed", commandProperties.CircuitBreakerForceClosed.Get()),
                new JProperty("propertyValue_circuitBreakerEnabled", commandProperties.CircuitBreakerEnabled.Get()),
                new JProperty("propertyValue_executionIsolationStrategy", commandProperties.ExecutionIsolationStrategy.Get()),
                new JProperty("propertyValue_executionIsolationThreadTimeoutInMilliseconds", (long)commandProperties.ExecutionIsolationThreadTimeout.Get().TotalMilliseconds),
                new JProperty("propertyValue_executionIsolationThreadInterruptOnTimeout", commandProperties.ExecutionIsolationThreadInterruptOnTimeout.Get()),
                new JProperty("propertyValue_executionIsolationThreadPoolKeyOverride", commandProperties.ExecutionIsolationThreadPoolKeyOverride.Get()),
                new JProperty("propertyValue_executionIsolationSemaphoreMaxConcurrentRequests", commandProperties.ExecutionIsolationSemaphoreMaxConcurrentRequests.Get()),
                new JProperty("propertyValue_fallbackIsolationSemaphoreMaxConcurrentRequests", commandProperties.FallbackIsolationSemaphoreMaxConcurrentRequests.Get()),
                new JProperty("propertyValue_metricsRollingStatisticalWindowInMilliseconds", commandProperties.MetricsRollingStatisticalWindowInMilliseconds.Get()),
                new JProperty("propertyValue_requestCacheEnabled", commandProperties.RequestCacheEnabled.Get()),
                new JProperty("propertyValue_requestLogEnabled", commandProperties.RequestLogEnabled.Get()),
                new JProperty("reportingHosts", 1));

            return(data.ToString(Formatting.None));
        }
 public static IHystrixMetricsPublisherCommand CreateOrRetrievePublisherForCommand(HystrixCommandKey commandKey, HystrixCommandGroupKey commandOwner, HystrixCommandMetrics metrics, IHystrixCircuitBreaker circuitBreaker, IHystrixCommandProperties properties)
 {
     return(instance.GetPublisherForCommand(commandKey, commandOwner, metrics, circuitBreaker, properties));
 }
 public static IHystrixMetricsPublisherCommand CreateOrRetrievePublisherForCommand(HystrixCommandKey commandKey, HystrixCommandGroupKey commandOwner, HystrixCommandMetrics metrics, IHystrixCircuitBreaker circuitBreaker, IHystrixCommandProperties properties)
 {
     return instance.GetPublisherForCommand(commandKey, commandOwner, metrics, circuitBreaker, properties);
 }
 public virtual IHystrixMetricsPublisherCommand GetMetricsPublisherForCommand(HystrixCommandKey commandKey, HystrixCommandGroupKey commandGroupKey, HystrixCommandMetrics metrics, IHystrixCircuitBreaker circuitBreaker, IHystrixCommandProperties properties)
 {
     return(new HystrixMetricsPublisherCommandDefault(commandKey, commandGroupKey, metrics, circuitBreaker, properties));
 }
 public IHystrixMetricsPublisherCommand GetPublisherForCommand(HystrixCommandKey commandKey, HystrixCommandGroupKey commandOwner, HystrixCommandMetrics metrics, IHystrixCircuitBreaker circuitBreaker, IHystrixCommandProperties properties)
 {
     return this.commandPublishers.GetOrAdd(commandKey.Name,
         w => this.strategy.GetMetricsPublisherForCommand(commandKey, commandOwner, metrics, circuitBreaker, properties),
         w => w.Initialize());
 }
Exemplo n.º 19
0
        public static List <HystrixCommandInfo> GetHystrixCommandInfo(string servicePath)
        {
            var             result   = new List <HystrixCommandInfo>();
            ServiceMetadata metadata = EndpointHost.Config.MetadataMap[servicePath];

            foreach (Operation operation in metadata.Operations)
            {
                HystrixCommandMetrics     commandMetrics    = operation.HystrixCommand.Metrics;
                IHystrixCircuitBreaker    circuitBreaker    = operation.HystrixCommand.CircuitBreaker;
                HealthCounts              healthCounts      = commandMetrics.GetHealthCounts();
                IHystrixCommandProperties commandProperties = commandMetrics.Properties;

                var commandInfo = new HystrixCommandInfo
                {
                    Type                                     = "HystrixCommand",
                    Name                                     = commandMetrics.OperationName,
                    Group                                    = commandMetrics.FullServiceName,
                    CurrentTime                              = DateTime.Now,
                    IsCircuitBreakerOpen                     = (circuitBreaker == null ? false : circuitBreaker.IsOpen()),
                    ErrorPercentage                          = healthCounts.ErrorPercentage,
                    ErrorCount                               = healthCounts.TotalErrorCount,
                    RequestCount                             = healthCounts.TotalRequests,
                    RollingCountSuccess                      = commandMetrics.GetRollingCount(HystrixRollingNumberEvent.Success),
                    RollingCountShortCircuited               = commandMetrics.GetRollingCount(HystrixRollingNumberEvent.ShortCircuited),
                    RollingCountTimeout                      = commandMetrics.GetRollingCount(HystrixRollingNumberEvent.Timeout),
                    RollingCountThreadPoolRejected           = commandMetrics.GetRollingCount(HystrixRollingNumberEvent.ThreadPoolRejected),
                    RollingCountFrameworkExceptionThrown     = commandMetrics.GetRollingCount(HystrixRollingNumberEvent.FrameworkExceptionThrown),
                    RollingCountServiceExceptionThrown       = commandMetrics.GetRollingCount(HystrixRollingNumberEvent.ServiceExceptionThrown),
                    RollingCountValidationExceptionThrown    = commandMetrics.GetRollingCount(HystrixRollingNumberEvent.ValidationExceptionThrown),
                    CumulativeCountSuccess                   = commandMetrics.GetCumulativeCount(HystrixRollingNumberEvent.Success),
                    CumulativeCountShortCircuited            = commandMetrics.GetCumulativeCount(HystrixRollingNumberEvent.ShortCircuited),
                    CumulativeCountTimeout                   = commandMetrics.GetCumulativeCount(HystrixRollingNumberEvent.Timeout),
                    CumulativeCountThreadPoolRejected        = commandMetrics.GetCumulativeCount(HystrixRollingNumberEvent.ThreadPoolRejected),
                    CumulativeCountFrameworkExcetpionThrown  = commandMetrics.GetCumulativeCount(HystrixRollingNumberEvent.FrameworkExceptionThrown),
                    CumulativeCountServiceExceptionThrown    = commandMetrics.GetCumulativeCount(HystrixRollingNumberEvent.ServiceExceptionThrown),
                    CumulativeCountValidationExceptionThrown = commandMetrics.GetCumulativeCount(HystrixRollingNumberEvent.ValidationExceptionThrown),
                    CurrentConcurrentExecutionCount          = commandMetrics.CurrentConcurrentExecutionCount,
                    LatencyExecuteMean                       = commandMetrics.GetServiceExecutionTimeMean(),
                    LatencyExecute                           = new PercentileInfo
                    {
                        P0      = commandMetrics.GetServiceExecutionTimePercentile(0),
                        P25     = commandMetrics.GetServiceExecutionTimePercentile(25),
                        P50     = commandMetrics.GetServiceExecutionTimePercentile(50),
                        P75     = commandMetrics.GetServiceExecutionTimePercentile(75),
                        P90     = commandMetrics.GetServiceExecutionTimePercentile(90),
                        P95     = commandMetrics.GetServiceExecutionTimePercentile(95),
                        P99     = commandMetrics.GetServiceExecutionTimePercentile(99),
                        P99DOT5 = commandMetrics.GetServiceExecutionTimePercentile(99.5),
                        P100    = commandMetrics.GetServiceExecutionTimePercentile(100),
                    },
                    LatencyTotalMean = commandMetrics.GetTotalTimeMean(),
                    LatencyTotal     = new PercentileInfo
                    {
                        P0      = commandMetrics.GetTotalTimePercentile(0),
                        P25     = commandMetrics.GetTotalTimePercentile(25),
                        P50     = commandMetrics.GetTotalTimePercentile(50),
                        P75     = commandMetrics.GetTotalTimePercentile(75),
                        P90     = commandMetrics.GetTotalTimePercentile(90),
                        P95     = commandMetrics.GetTotalTimePercentile(95),
                        P99     = commandMetrics.GetTotalTimePercentile(99),
                        P99DOT5 = commandMetrics.GetTotalTimePercentile(99.5),
                        P100    = commandMetrics.GetTotalTimePercentile(100),
                    },
                    PropertyValue_CircuitBreakerRequestVolumeThreshold    = commandProperties.CircuitBreakerRequestVolumeThreshold.Get(),
                    PropertyValue_CircuitBreakerSleepWindowInMilliseconds = (long)commandProperties.CircuitBreakerSleepWindow.Get().TotalMilliseconds,
                    PropertyValue_CircuitBreakerErrorThresholdPercentage  = commandProperties.CircuitBreakerErrorThresholdPercentage.Get(),
                    PropertyValue_CircuitBreakerForceOpen   = commandProperties.CircuitBreakerForceOpen.Get(),
                    PropertyValue_CircuitBreakerForceClosed = commandProperties.CircuitBreakerForceClosed.Get(),
                    PropertyValue_CircuitBreakerEnabled     = commandProperties.CircuitBreakerEnabled.Get(),
                    PropertyValue_ExecutionIsolationThreadTimeoutInMilliseconds = (long)operation.HystrixCommand.GetExecutionTimeout().TotalMilliseconds,
                    PropertyValue_MetricsRollingStatisticalWindowInMilliseconds = commandProperties.MetricsRollingStatisticalWindowInMilliseconds.Get(),
                    PropertyValue_RequestLogEnabled = commandProperties.RequestLogEnabled.Get(),
                    ReportingHosts = 1,
                };

                result.Add(commandInfo);
            }

            return(result);
        }