public class HystrixCollapserMetrics extends HystrixMetrics
HystrixCollapser
to record metrics.
HystrixEventNotifier
not hooked up yet. It may be in the future.Modifier and Type | Field and Description |
---|---|
static rx.functions.Func2<long[],com.netflix.hystrix.metric.HystrixCollapserEvent,long[]> |
appendEventToBucket |
static rx.functions.Func2<long[],long[],long[]> |
bucketAggregator |
counter
Modifier and Type | Method and Description |
---|---|
int |
getBatchSizeMean() |
int |
getBatchSizePercentile(double percentile)
Retrieve the batch size for the
HystrixCollapser being invoked at a given percentile. |
HystrixCollapserKey |
getCollapserKey()
HystrixCollapserKey these metrics represent. |
long |
getCumulativeCount(HystrixEventType.Collapser collapserEventType) |
long |
getCumulativeCount(com.netflix.hystrix.util.HystrixRollingNumberEvent event)
Get the cumulative count since the start of the application for the given
HystrixRollingNumberEvent . |
static HystrixCollapserMetrics |
getInstance(HystrixCollapserKey key,
HystrixCollapserProperties properties)
Get or create the
HystrixCollapserMetrics instance for a given HystrixCollapserKey . |
static java.util.Collection<HystrixCollapserMetrics> |
getInstances()
All registered instances of
HystrixCollapserMetrics |
HystrixCollapserProperties |
getProperties() |
long |
getRollingCount(HystrixEventType.Collapser collapserEventType) |
long |
getRollingCount(com.netflix.hystrix.util.HystrixRollingNumberEvent event)
Get the rolling count for the given
HystrixRollingNumberEvent . |
int |
getShardSizeMean() |
int |
getShardSizePercentile(double percentile)
Retrieve the shard size for the
HystrixCollapser being invoked at a given percentile. |
void |
markBatch(int batchSize) |
void |
markRequestBatched() |
void |
markResponseFromCache() |
void |
markShards(int numShards) |
public static final rx.functions.Func2<long[],com.netflix.hystrix.metric.HystrixCollapserEvent,long[]> appendEventToBucket
public static final rx.functions.Func2<long[],long[],long[]> bucketAggregator
public static HystrixCollapserMetrics getInstance(HystrixCollapserKey key, HystrixCollapserProperties properties)
HystrixCollapserMetrics
instance for a given HystrixCollapserKey
.
This is thread-safe and ensures only 1 HystrixCollapserMetrics
per HystrixCollapserKey
.
key
- HystrixCollapserKey
of HystrixCollapser
instance requesting the HystrixCollapserMetrics
HystrixCollapserMetrics
public static java.util.Collection<HystrixCollapserMetrics> getInstances()
HystrixCollapserMetrics
Collection<HystrixCollapserMetrics>
public HystrixCollapserKey getCollapserKey()
HystrixCollapserKey
these metrics represent.public HystrixCollapserProperties getProperties()
public long getRollingCount(HystrixEventType.Collapser collapserEventType)
public long getCumulativeCount(HystrixEventType.Collapser collapserEventType)
public long getCumulativeCount(com.netflix.hystrix.util.HystrixRollingNumberEvent event)
HystrixMetrics
HystrixRollingNumberEvent
.getCumulativeCount
in class HystrixMetrics
event
- HystrixRollingNumberEvent
of the event to retrieve a sum forpublic long getRollingCount(com.netflix.hystrix.util.HystrixRollingNumberEvent event)
HystrixMetrics
HystrixRollingNumberEvent
.
The rolling window is defined by HystrixCommandProperties.metricsRollingStatisticalWindowInMilliseconds()
.
getRollingCount
in class HystrixMetrics
event
- HystrixRollingNumberEvent
of the event to retrieve a sum forpublic int getBatchSizePercentile(double percentile)
HystrixCollapser
being invoked at a given percentile.
Percentile capture and calculation is configured via HystrixCollapserProperties.metricsRollingStatisticalWindowInMilliseconds()
and other related properties.
percentile
- Percentile such as 50, 99, or 99.5.public int getBatchSizeMean()
public int getShardSizePercentile(double percentile)
HystrixCollapser
being invoked at a given percentile.
Percentile capture and calculation is configured via HystrixCollapserProperties.metricsRollingStatisticalWindowInMilliseconds()
and other related properties.
percentile
- Percentile such as 50, 99, or 99.5.public int getShardSizeMean()
public void markRequestBatched()
public void markResponseFromCache()
public void markBatch(int batchSize)
public void markShards(int numShards)