Skip to content

TypeResample🔗

Constructor🔗

TypeResample()

Methods🔗

build🔗

Builds the object.

def build() -> expr.TypeResample

datasource🔗

The datasource

def datasource(datasource: dashboard.DataSourceRef) -> typing.Self

downsampler🔗

The downsample function

Possible enum values:

  • "sum"

  • "mean"

  • "min"

  • "max"

  • "count"

  • "last"

  • "median"

def downsampler(downsampler: typing.Literal["sum", "mean", "min", "max", "count", "last", "median"]) -> typing.Self

expression🔗

The math expression

def expression(expression: str) -> typing.Self

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)

def hide(hide: bool) -> typing.Self

interval_ms🔗

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

def interval_ms(interval_ms: float) -> typing.Self

max_data_points🔗

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

def max_data_points(max_data_points: int) -> typing.Self

query_type🔗

QueryType is an optional identifier for the type of query.

It can be used to distinguish different types of queries.

def query_type(query_type: str) -> typing.Self

ref_id🔗

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

def ref_id(ref_id: str) -> typing.Self

result_assertions🔗

Optionally define expected query result behavior

def result_assertions(result_assertions: cogbuilder.Builder[expr.ExprTypeResampleResultAssertions]) -> typing.Self

time_range🔗

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

def time_range(time_range: cogbuilder.Builder[expr.ExprTypeResampleTimeRange]) -> typing.Self

upsampler🔗

The upsample function

Possible enum values:

  • "pad" Use the last seen value

  • "backfilling" backfill

  • "fillna" Do not fill values (nill)

def upsampler(upsampler: typing.Literal["pad", "backfilling", "fillna"]) -> typing.Self

window🔗

The time duration

def window(window: str) -> typing.Self

See also🔗