Skip to content

TypeResampleBuilder🔗

Constructor🔗

func NewTypeResampleBuilder() *TypeResampleBuilder

Methods🔗

Build🔗

Builds the object.

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

Datasource🔗

The datasource

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

Downsampler🔗

The downsample function

Possible enum values:

  • "sum"

  • "mean"

  • "min"

  • "max"

  • "count"

  • "last"

  • "median"

func (builder *TypeResampleBuilder) Downsampler(downsampler expr.TypeResampleDownsampler) *TypeResampleBuilder

Expression🔗

The math expression

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

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 *TypeResampleBuilder) Hide(hide bool) *TypeResampleBuilder

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 *TypeResampleBuilder) IntervalMs(intervalMs float64) *TypeResampleBuilder

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 *TypeResampleBuilder) MaxDataPoints(maxDataPoints int64) *TypeResampleBuilder

QueryType🔗

QueryType is an optional identifier for the type of query.

It can be used to distinguish different types of queries.

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

RefId🔗

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

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

ResultAssertions🔗

Optionally define expected query result behavior

func (builder *TypeResampleBuilder) ResultAssertions(resultAssertions cog.Builder[expr.ExprTypeResampleResultAssertions]) *TypeResampleBuilder

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 *TypeResampleBuilder) TimeRange(timeRange cog.Builder[expr.ExprTypeResampleTimeRange]) *TypeResampleBuilder

Upsampler🔗

The upsample function

Possible enum values:

  • "pad" Use the last seen value

  • "backfilling" backfill

  • "fillna" Do not fill values (nill)

func (builder *TypeResampleBuilder) Upsampler(upsampler expr.TypeResampleUpsampler) *TypeResampleBuilder

Window🔗

The time duration

func (builder *TypeResampleBuilder) Window(window string) *TypeResampleBuilder

See also🔗