Extract functions docs into separate pages

This commit is contained in:
David Arendsen 2022-12-30 14:23:00 +01:00
commit a79f390531
2 changed files with 91 additions and 67 deletions

View file

@ -4,70 +4,4 @@
On this page you will find the methods you can use in the query builder. On this page you will find the methods you can use in the query builder.
### addAggregateWindow() * [addAggregateWindow()](functions/addAggregateWindow.md)
**Parameters:**
<table>
<tbody>
<tr>
<th>Name</th>
<th>Data type</th>
<th>Description</th>
<th>Example</th>
</tr>
<tr>
<td>every</td>
<td>string</td>
<td>Duration of time between windows.</td>
<td>20s</td>
</tr>
<tr>
<td>fn</td>
<td>string</td>
<td>Aggregate or selector function to apply to each time window.</td>
<td>mean</td>
</tr>
<tr>
<td>options</td>
<td>array</td>
<td>
<ul>
<li>
period (string): <i>Duration of windows. Default is the 'every' value.</i>
</li>
<li>
offset (string): <i>Duration to shift the window boundaries by. Default is '0s'.</i>
</li>
<li>
location (string): <i>Location used to determine timezone. Default is the 'location' option.</i>
</li>
<li>
column (string): <i>Column to operate on.</i>
</li>
<li>
timeSrc (string): <i>Column to use as the source of the new time value for aggregate values. Default is '_stop'.</i>
</li>
<li>
timeDst (string): <i>Column to store time values for aggregate values in. Default is '_time'.</i>
</li>
<li>
createEmpty (boolean): <i>Create empty tables for empty window. Default is true.</i>
</li>
</ul>
</td>
<td>
<ul>
<li>period: <i>'every'</i></li>
<li>offset: <i>'2s'</i></li>
<li>location: <i>'location'</i></li>
<li>column: <i>'_value'</i></li>
<li>timeSrc: <i>'_stop'</i></li>
<li>timeDst: <i>'_time'</i></li>
<li>createEmpty: <i>false</i></li>
</ul>
</td>
</tr>
</tbody>
</table>

View file

@ -0,0 +1,90 @@
# Flux Query Builder Docs
## Functions &raquo; addAggregateWindow()
### Parameters:
<table>
<tbody>
<tr>
<th>Name</th>
<th>Data type</th>
<th>Description</th>
</tr>
<tr>
<td>every</td>
<td>string</td>
<td>Duration of time between windows.</td>
</tr>
<tr>
<td>fn</td>
<td>string</td>
<td>Aggregate or selector function to apply to each time window.</td>
</tr>
<tr>
<td>options</td>
<td>array</td>
<td>
<ul>
<li>
period (string): <i>Duration of windows. Default is the 'every' value.</i>
</li>
<li>
offset (string): <i>Duration to shift the window boundaries by. Default is '0s'.</i>
</li>
<li>
location (string): <i>Location used to determine timezone. Default is the 'location' option.</i>
</li>
<li>
column (string): <i>Column to operate on.</i>
</li>
<li>
timeSrc (string): <i>Column to use as the source of the new time value for aggregate values. Default is '_stop'.</i>
</li>
<li>
timeDst (string): <i>Column to store time values for aggregate values in. Default is '_time'.</i>
</li>
<li>
createEmpty (boolean): <i>Create empty tables for empty window. Default is true.</i>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
### Example
```php
->addAgregateWindow('20s', 'mean', [
'period' => 'every',
'offset' => '2s',
'location' => 'location',
'column' => '_value',
'timeSrc' => '_stop',
'timeDst' => '_time',
'createEmpty' => false,
])
```
This will result in the following Flux function part:
```
|> aggregateWindow(
every: 20s,
period: every,
offset: 0s,
fn: mean,
location: "location",
column: "_value",
timeSrc: "_stop",
timeDst: "_time",
createEmpty: false
)
```
### Extra resources
* [Flux documentation](https://docs.influxdata.com/flux/v0.x/stdlib/universe/aggregatewindow/)