public class AggregatorFactory extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
AggregatorFactory.FilterOperation |
static class |
AggregatorFactory.Trim |
| 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 SamplingAggregator |
createDataGapsMarkingAggregator(int value,
TimeUnit unit)
Creates an aggregator that marks gaps in data according to sampling rate with a null data point.
|
static Aggregator |
createDiffAggregator()
Creates an aggregator that computes the difference between successive data points.
|
static CustomAggregator |
createDivAggregator(double divisor)
Creates an aggregator that divides each value by the divisor.
|
static CustomAggregator |
createFilterAggregator(AggregatorFactory.FilterOperation operation,
double threshold)
Creates an aggregator that filters datapoints according to the filter operation.
|
static SamplingAggregator |
createFirstAggregator(int value,
TimeUnit unit)
Creates an aggregator that returns the first data point for the time range.
|
static SamplingAggregator |
createLastAggregator(int value,
TimeUnit unit)
Creates an aggregator that returns the last data point for the time range.
|
static SamplingAggregator |
createLeastSquaresAggregator(int value,
TimeUnit unit)
Creates an aggregator that returns a best fit line through the datapoints using the least squares algorithm..
|
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 PercentileAggregator |
createPercentileAggregator(double percentile,
int value,
TimeUnit unit)
Creates an aggregator that returns the percentile value for a given percentage of all values over 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 Aggregator |
createSamplerAggregator()
Creates an aggregator that computes the sampling rate of change for the data points.
|
static CustomAggregator |
createSaveAsAggregator(String newMetricName)
Creates an aggregator that saves the results of the query to a new metric.
|
static CustomAggregator |
createScaleAggregator(double factor)
Creates an aggregator that scales each data point by a factor.
|
static CustomAggregator |
createSimpleMovingAverage(int numPeriods)
Creates an aggregator that calculates a simple moving average for the number of
specified periods.
|
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.
|
static CustomAggregator |
createTrimAggregator(AggregatorFactory.Trim trim)
Creates an aggregator that trim of the first, last, or both data points returned by the query.
|
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 PercentileAggregator createPercentileAggregator(double percentile, int value, TimeUnit unit)
percentile - percentagevalue - value for time periodunit - unit of timepublic static CustomAggregator createDivAggregator(double divisor)
divisor - divisor.public static SamplingAggregator createLastAggregator(int value, TimeUnit unit)
value - value for time period.unit - unit of timepublic static SamplingAggregator createFirstAggregator(int value, TimeUnit unit)
value - value for time period.unit - unit of timepublic static SamplingAggregator createDataGapsMarkingAggregator(int value, TimeUnit unit)
value - value for time period.unit - unit of timepublic static SamplingAggregator createLeastSquaresAggregator(int value, TimeUnit unit)
value - value for time period.unit - unit of timepublic static Aggregator createDiffAggregator()
public static Aggregator createSamplerAggregator()
public static CustomAggregator createSimpleMovingAverage(int numPeriods)
numPeriods - number of periodspublic static CustomAggregator createScaleAggregator(double factor)
factor - factor to scale bypublic static CustomAggregator createCustomAggregator(String name, String json)
Aggregator aggregator = AggregatorFactory.createCustomAggregator("scale", "\"factor\": 0.75");
"name":"scale",
"factor": 0.75
name - name of the aggregator.json - aggregator JSON fragmentpublic static RateAggregator createRateAggregator(TimeUnit unit)
unit - unit of timepublic static CustomAggregator createSaveAsAggregator(String newMetricName)
newMetricName - metric to save results topublic static CustomAggregator createTrimAggregator(AggregatorFactory.Trim trim)
trim - what to trimpublic static CustomAggregator createFilterAggregator(AggregatorFactory.FilterOperation operation, double threshold)
operation - what to filter onthreshold - the value the operation is performed on. If the operation is lt, then a null data point is returned if the data point is less than the threshold.Copyright © 2018. All rights reserved.