TypeReduce
grafonnet.query.expr.TypeReduce
Index
fn withDatasource(value)fn withDatasourceMixin(value)fn withExpression(value)fn withHide(value=true)fn withIntervalMs(value)fn withMaxDataPoints(value)fn withQueryType(value)fn withReducer(value)fn withRefId(value)fn withResultAssertions(value)fn withResultAssertionsMixin(value)fn withSettings(value)fn withSettingsMixin(value)fn withTimeRange(value)fn withTimeRangeMixin(value)fn withType()obj datasourceobj resultAssertionsobj settingsobj timeRange
Fields
fn withDatasource
withDatasource(value)
PARAMETERS:
- value (
object)
Ref to a DataSource instance
fn withDatasourceMixin
withDatasourceMixin(value)
PARAMETERS:
- value (
object)
Ref to a DataSource instance
fn withExpression
withExpression(value)
PARAMETERS:
- value (
string)
Reference to single query result
fn withHide
withHide(value=true)
PARAMETERS:
- value (
boolean)- default value:
true
- default value:
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)
fn withIntervalMs
withIntervalMs(value)
PARAMETERS:
- value (
number)
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
fn withMaxDataPoints
withMaxDataPoints(value)
PARAMETERS:
- value (
integer)
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
fn withQueryType
withQueryType(value)
PARAMETERS:
- value (
string)
QueryType is an optional identifier for the type of query. It can be used to distinguish different types of queries.
fn withReducer
withReducer(value)
PARAMETERS:
- value (
string)- valid values:
"sum","mean","min","max","count","last","median"
- valid values:
The reducer Possible enum values: - "sum" - "mean" - "min" - "max" - "count" - "last" - "median"
fn withRefId
withRefId(value)
PARAMETERS:
- value (
string)
RefID is the unique identifier of the query, set by the frontend call.
fn withResultAssertions
withResultAssertions(value)
PARAMETERS:
- value (
object)
Optionally define expected query result behavior
fn withResultAssertionsMixin
withResultAssertionsMixin(value)
PARAMETERS:
- value (
object)
Optionally define expected query result behavior
fn withSettings
withSettings(value)
PARAMETERS:
- value (
object)
Reducer Options
fn withSettingsMixin
withSettingsMixin(value)
PARAMETERS:
- value (
object)
Reducer Options
fn withTimeRange
withTimeRange(value)
PARAMETERS:
- value (
object)
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
fn withTimeRangeMixin
withTimeRangeMixin(value)
PARAMETERS:
- value (
object)
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
fn withType
withType()
obj datasource
fn datasource.withType
datasource.withType(value)
PARAMETERS:
- value (
string)
The plugin type-id
fn datasource.withUid
datasource.withUid(value)
PARAMETERS:
- value (
string)
Specific datasource instance
obj resultAssertions
fn resultAssertions.withMaxFrames
resultAssertions.withMaxFrames(value)
PARAMETERS:
- value (
integer)
Maximum frame count
fn resultAssertions.withType
resultAssertions.withType(value)
PARAMETERS:
- value (
string)- valid values:
"","timeseries-wide","timeseries-long","timeseries-many","timeseries-multi","directory-listing","table","numeric-wide","numeric-multi","numeric-long","log-lines"
- valid values:
Type asserts that the frame matches a known type structure. Possible enum values: - "" - "timeseries-wide" - "timeseries-long" - "timeseries-many" - "timeseries-multi" - "directory-listing" - "table" - "numeric-wide" - "numeric-multi" - "numeric-long" - "log-lines"
fn resultAssertions.withTypeVersion
resultAssertions.withTypeVersion(value)
PARAMETERS:
- value (
array)
TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane contract documentation https://grafana.github.io/dataplane/contract/.
fn resultAssertions.withTypeVersionMixin
resultAssertions.withTypeVersionMixin(value)
PARAMETERS:
- value (
array)
TypeVersion is the version of the Type property. Versions greater than 0.0 correspond to the dataplane contract documentation https://grafana.github.io/dataplane/contract/.
obj settings
fn settings.withMode
settings.withMode(value)
PARAMETERS:
- value (
string)- valid values:
"dropNN","replaceNN"
- valid values:
Non-number reduce behavior Possible enum values: - "dropNN" Drop non-numbers - "replaceNN" Replace non-numbers
fn settings.withReplaceWithValue
settings.withReplaceWithValue(value)
PARAMETERS:
- value (
number)
Only valid when mode is replace
obj timeRange
fn timeRange.withFrom
timeRange.withFrom(value="now-6h")
PARAMETERS:
- value (
string)- default value:
"now-6h"
- default value:
From is the start time of the query.
fn timeRange.withTo
timeRange.withTo(value="now")
PARAMETERS:
- value (
string)- default value:
"now"
- default value:
To is the end time of the query.