Class Query.Builder
- java.lang.Object
-
- com.elastisys.autoscaler.metricstreamers.influxdb.config.Query.Builder
-
- Enclosing class:
- Query
public static class Query.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Querybuild()Query.Builderfrom(java.lang.String from)FROMclause.Query.BuildergroupBy(java.lang.String groupBy)GROUP BYclause.Query.Builderselect(java.lang.String select)SELECTclause.Query.Builderwhere(java.lang.String where)WHEREclause.
-
-
-
Method Detail
-
build
public Query build()
-
select
public Query.Builder select(java.lang.String select)
SELECTclause. For example,mean('request_rate')ornon_negative_derivative(max('value'), 1s). The select statement should select one single field/column (only the first field is handled in result processing). The selected field/column must be a numeric value. If not, errors will be raised during result processing.- Parameters:
select-- Returns:
-
from
public Query.Builder from(java.lang.String from)
FROMclause. Specifies the measurement to query for. For example,cpu/system.- Parameters:
from-- Returns:
-
where
public Query.Builder where(java.lang.String where)
WHEREclause. Used to filter data based on tags/field values. Avoid filtering ontimein theWHEREclause, as selecting the approriate interval for which to fetch metrics will be handled by theInfluxdbMetricStreamer. Behavior is undefined iftimefilters are inclued.- Parameters:
where-- Returns:
-
groupBy
public Query.Builder groupBy(java.lang.String groupBy)
GROUP BYclause. Can be used to downsample data (if combined with an aggregation function in theSELECTclause), for example by specifying something liketime(10s) fill(none). Note: do not group on tags, since that will create different series in the result (one per group) and the result handler will only process the first series (the order may not be deterministic). Use aWHEREclause to query for a particular combination of tags.- Parameters:
groupBy-- Returns:
-
-