Package step.core.timeseries
Class TimeSeriesAggregationQuery
- java.lang.Object
-
- step.core.timeseries.TimeSeriesAggregationQuery
-
public class TimeSeriesAggregationQuery extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTimeSeriesAggregationQuery(TimeSeriesAggregationPipeline aggregationPipeline)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<Long>drawAxis()TimeSeriesAggregationQueryfilter(Map<String,String> filters)Specifies the mandatory list of key-value attributes that the series should matchprotected LonggetBucketIndexFrom()protected LonggetBucketIndexTo()protected longgetBucketSize()protected Map<String,String>getFilters()protected Set<String>getGroupDimensions()protected Function<Long,Long>getProjectionFunction()TimeSeriesAggregationQuerygroup()Group all the selected series in one seriesTimeSeriesAggregationQuerygroupBy(Set<String> dimensions)TimeSeriesAggregationQueryrange(long from, long to)Specifies a time range for the queryTimeSeriesAggregationResponserun()TimeSeriesAggregationQuerysplit(long targetNumberOfBuckets)Specifies the desired number of buckets in the result.TimeSeriesAggregationQuerywindow(long resolution)Defines the desired resolution.
-
-
-
Constructor Detail
-
TimeSeriesAggregationQuery
protected TimeSeriesAggregationQuery(TimeSeriesAggregationPipeline aggregationPipeline)
-
-
Method Detail
-
range
public TimeSeriesAggregationQuery range(long from, long to)
Specifies a time range for the query- Parameters:
from- the beginning of the time range in ms (Epoch time)to- the end of the time range (Epoch time)- Returns:
- the builder
-
filter
public TimeSeriesAggregationQuery filter(Map<String,String> filters)
Specifies the mandatory list of key-value attributes that the series should match- Parameters:
filters- the mandatory key-value attributes that the series should match- Returns:
- the builder
-
group
public TimeSeriesAggregationQuery group()
Group all the selected series in one series- Returns:
- the builder
-
groupBy
public TimeSeriesAggregationQuery groupBy(Set<String> dimensions)
-
window
public TimeSeriesAggregationQuery window(long resolution)
Defines the desired resolution.
If the desired resolution isn't a multiple of the source resolution it will floored to the closest valid resolution- Parameters:
resolution- the desired resolution in ms- Returns:
- the builder
-
split
public TimeSeriesAggregationQuery split(long targetNumberOfBuckets)
Specifies the desired number of buckets in the result. - For targetNumberOfBuckets = 1 the resulting number of buckets will be exactly 1 - For targetNumberOfBuckets > 1 the resulting number of buckets will be as close as possible to the specified target- Parameters:
targetNumberOfBuckets- the desired number of buckets in the result- Returns:
- the builder
-
getBucketIndexFrom
protected Long getBucketIndexFrom()
-
getBucketIndexTo
protected Long getBucketIndexTo()
-
getBucketSize
protected long getBucketSize()
-
run
public TimeSeriesAggregationResponse run()
-
-