Class HystrixRollingPercentile
Inheritance
Inherited Members
Namespace: Hystrix.Dotnet
Assembly: Hystrix.Dotnet.dll
Syntax
public class HystrixRollingPercentile
Constructors
| Improve this Doc View SourceHystrixRollingPercentile(IDateTimeProvider, Int32, Int32, Int32, IHystrixConfigurationService)
Declaration
public HystrixRollingPercentile(IDateTimeProvider dateTimeProvider, int timeInMilliseconds, int numberOfBuckets, int bucketDataLength, IHystrixConfigurationService configurationService)
Parameters
Type | Name | Description |
---|---|---|
IDateTimeProvider | dateTimeProvider | |
System.Int32 | timeInMilliseconds | |
System.Int32 | numberOfBuckets | |
System.Int32 | bucketDataLength | |
IHystrixConfigurationService | configurationService |
Methods
| Improve this Doc View SourceAddValue(Int32[])
Add value (or values) to current bucket.
Declaration
public void AddValue(params int[] values)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | values | Value to be stored in current bucket such as execution latency in milliseconds. |
GetMean()
This returns the mean (average) of all values in the current snapshot. This is not a percentile but often desired so captured and exposed here.
Declaration
public int GetMean()
Returns
Type | Description |
---|---|
System.Int32 | Mean of all values. |
GetPercentile(Double)
Compute a percentile from the underlying rolling buckets of values. For performance reasons it maintains a single snapshot of the sorted values from all buckets that is re-generated each time the bucket rotates. This means that if a bucket is 5000ms, then this method will re-compute a percentile at most once every 5000ms.
Declaration
public int GetPercentile(double percentile)
Parameters
Type | Name | Description |
---|---|---|
System.Double | percentile | Value such as 99 (99th percentile), 99.5 (99.5th percentile), 50 (median, 50th percentile) to compute and retrieve percentile from rolling buckets. |
Returns
Type | Description |
---|---|
System.Int32 | The percentile value. |
Reset()
Force a reset so that percentiles start being gathered from scratch.
Declaration
public void Reset()