Skip to content

TypeReduceBuilder🔗

Constructor🔗

func NewTypeReduceBuilder() *TypeReduceBuilder

Methods🔗

Build🔗

Builds the object.

func (builder *TypeReduceBuilder) Build() (variants.Dataquery, error)

Datasource🔗

The datasource

func (builder *TypeReduceBuilder) Datasource(datasource dashboard.DataSourceRef) *TypeReduceBuilder

Expression🔗

Reference to single query result

func (builder *TypeReduceBuilder) Expression(expression string) *TypeReduceBuilder

Hide🔗

true if query is disabled (ie should not be returned to the dashboard)

NOTE: this does not always imply that the query should not be executed since

the results from a hidden query may be used as the input to other queries (SSE etc)

func (builder *TypeReduceBuilder) Hide(hide bool) *TypeReduceBuilder

IntervalMs🔗

Interval is the suggested duration between time points in a time series query.

NOTE: the values for intervalMs is not saved in the query model. It is typically calculated

from the interval required to fill a pixels in the visualization

func (builder *TypeReduceBuilder) IntervalMs(intervalMs float64) *TypeReduceBuilder

MaxDataPoints🔗

MaxDataPoints is the maximum number of data points that should be returned from a time series query.

NOTE: the values for maxDataPoints is not saved in the query model. It is typically calculated

from the number of pixels visible in a visualization

func (builder *TypeReduceBuilder) MaxDataPoints(maxDataPoints int64) *TypeReduceBuilder

QueryType🔗

QueryType is an optional identifier for the type of query.

It can be used to distinguish different types of queries.

func (builder *TypeReduceBuilder) QueryType(queryType string) *TypeReduceBuilder

Reducer🔗

The reducer

Possible enum values:

  • "sum"

  • "mean"

  • "min"

  • "max"

  • "count"

  • "last"

  • "median"

func (builder *TypeReduceBuilder) Reducer(reducer expr.TypeReduceReducer) *TypeReduceBuilder

RefId🔗

RefID is the unique identifier of the query, set by the frontend call.

func (builder *TypeReduceBuilder) RefId(refId string) *TypeReduceBuilder

ResultAssertions🔗

Optionally define expected query result behavior

func (builder *TypeReduceBuilder) ResultAssertions(resultAssertions cog.Builder[expr.ExprTypeReduceResultAssertions]) *TypeReduceBuilder

Settings🔗

Reducer Options

func (builder *TypeReduceBuilder) Settings(settings cog.Builder[expr.ExprTypeReduceSettings]) *TypeReduceBuilder

TimeRange🔗

TimeRange represents the query range

NOTE: unlike generic /ds/query, we can now send explicit time values in each query

NOTE: the values for timeRange are not saved in a dashboard, they are constructed on the fly

func (builder *TypeReduceBuilder) TimeRange(timeRange cog.Builder[expr.ExprTypeReduceTimeRange]) *TypeReduceBuilder

See also🔗