updates to intervals and windows function based on spec
parent
f7e16b7e34
commit
cf17a867df
|
@ -18,9 +18,13 @@ The generator is then used to produce the set of intervals.
|
|||
The set of intervals includes all intervals that intersect with the initial range of time.
|
||||
|
||||
{{% note %}}
|
||||
The `intervals()` function is designed to be used with the intervals parameter of the [`window()` function](/v2.0/reference/flux/functions/transformations/window).
|
||||
The `intervals()` function is designed to be used with the intervals parameter
|
||||
of the [`window()` function](/v2.0/reference/flux/functions/transformations/window).
|
||||
{{% /note %}}
|
||||
|
||||
By default the end boundary of an interval will align with the Unix epoch (zero time)
|
||||
modified by the offset of the `location` option.
|
||||
|
||||
_**Function type:** Miscellaneous_
|
||||
_**Output data type:** Object_
|
||||
|
||||
|
@ -46,9 +50,9 @@ Defaults to the value of the `every` duration.
|
|||
_**Data type:** Duration_
|
||||
|
||||
### offset
|
||||
The offset duration relative to the location offset.
|
||||
The duration by which to shift the window boundaries.
|
||||
It can be negative, indicating that the offset goes backwards in time.
|
||||
Defaults to `0h`.
|
||||
Defaults to `0`, which will align window end boundaries with the `every` duration.
|
||||
|
||||
_**Data type:** Duration_
|
||||
|
||||
|
|
|
@ -16,6 +16,9 @@ Those columns are added to the group key of the output tables.
|
|||
|
||||
A single input record will be placed into zero or more output tables, depending on the specific windowing function.
|
||||
|
||||
By default the start boundary of a window will align with the Unix epoch (zero time)
|
||||
modified by the offset of the `location` option.
|
||||
|
||||
_**Function type:** Transformation_
|
||||
_**Output data type:** Object_
|
||||
|
||||
|
@ -23,10 +26,11 @@ _**Output data type:** Object_
|
|||
window(
|
||||
every: 5m,
|
||||
period: 5m,
|
||||
start: 12h,
|
||||
offset: 12h,
|
||||
timeColumn: "_time",
|
||||
startColumn: "_start",
|
||||
stopColumn: "_stop"
|
||||
stopColumn: "_stop",
|
||||
createEmpty: false
|
||||
)
|
||||
|
||||
// OR
|
||||
|
@ -35,7 +39,8 @@ window(
|
|||
intervals: intervals(every: 5m, period: 5m, offset: 12h),
|
||||
timeColumn: "_time",
|
||||
startColumn: "_start",
|
||||
stopColumn: "_stop"
|
||||
stopColumn: "_stop",
|
||||
createEmpty: false
|
||||
)
|
||||
```
|
||||
|
||||
|
@ -59,10 +64,10 @@ Defaults to `every` value.
|
|||
|
||||
_**Data type:** Duration_
|
||||
|
||||
### start
|
||||
The start window time relative to the [`location`](/v2.0/reference/flux/language/options/#location) offset.
|
||||
It can be negative, indicating that the start goes backwards in time.
|
||||
The default aligns the window boundaries with `now`.
|
||||
### offset
|
||||
Offset is the duration by which to shift the window boundaries.
|
||||
It can be negative, indicating that the offset goes backwards in time.
|
||||
Defaults to 0, which will align window end boundaries with the `every` duration.
|
||||
|
||||
_**Data type:** Duration_
|
||||
|
||||
|
@ -98,6 +103,10 @@ Defaults to `"_stop"`.
|
|||
|
||||
_**Data type:** String_
|
||||
|
||||
### createEmpty
|
||||
Specifies whether empty tables should be created.
|
||||
Defaults to `false`.
|
||||
|
||||
## Examples
|
||||
|
||||
#### Window data into 10 minute intervals
|
||||
|
|
Loading…
Reference in New Issue