public class AggregatorFactory extends Object
Constructor and Description |
---|
AggregatorFactory() |
Modifier and Type | Method and Description |
---|---|
static SamplingAggregator |
createAverageAggregator(int value,
TimeUnit unit)
Creates an aggregator that returns the average values for each time period as specified.
|
static SamplingAggregator |
createCountAggregator(int value,
TimeUnit unit)
Creates an aggregator that returns the count of all values over each time period as specified.
|
static CustomAggregator |
createCustomAggregator(String name,
String json)
Creates an aggregator with a custom json fragment.
|
static CustomAggregator |
createDivAggregator(double divisor)
Creates an aggregator that divides each value by the divisor.
|
static SamplingAggregator |
createMaxAggregator(int value,
TimeUnit unit)
Creates an aggregator that returns the maximum values for each time period as specified.
|
static SamplingAggregator |
createMinAggregator(int value,
TimeUnit unit)
Creates an aggregator that returns the minimum values for each time period as specified.
|
static RateAggregator |
createRateAggregator(TimeUnit unit)
Creates an aggregator that returns the rate of change between each pair of data points
|
static SamplingAggregator |
createStandardDeviationAggregator(int value,
TimeUnit unit)
Creates an aggregator that returns the standard deviation values for each time period as specified.
|
static SamplingAggregator |
createSumAggregator(int value,
TimeUnit unit)
Creates an aggregator that returns the sum of all values over each time period as specified.
|
public static SamplingAggregator createMinAggregator(int value, TimeUnit unit)
value
- value for time period.unit
- unit of timepublic static SamplingAggregator createMaxAggregator(int value, TimeUnit unit)
value
- value for time period.unit
- unit of timepublic static SamplingAggregator createAverageAggregator(int value, TimeUnit unit)
value
- value for time period.unit
- unit of timepublic static SamplingAggregator createStandardDeviationAggregator(int value, TimeUnit unit)
value
- value for time period.unit
- unit of timepublic static SamplingAggregator createSumAggregator(int value, TimeUnit unit)
value
- value for time period.unit
- unit of timepublic static SamplingAggregator createCountAggregator(int value, TimeUnit unit)
value
- value for time period.unit
- unit of timepublic static CustomAggregator createDivAggregator(double divisor)
divisor
- divisor.public static CustomAggregator createCustomAggregator(String name, String json)
Example:
Aggregator aggregator = AggregatorFactory.createCustomAggregator("histogram", "\"percentile\": 0.75");
This produces aggregator JSON that looks like this:
"name":"histogram", "percentile": 0.75
name
- name of the aggregator.json
- aggregator JSON fragmentpublic static RateAggregator createRateAggregator(TimeUnit unit)
unit
- unit of timeCopyright © 2014. All rights reserved.