influxdata / influxdata/influxdb
Question: aggregateWindow function doesn't work as my expectation
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
Data Set:
|_start|_stop|_time|_value|_field|_measurementservice|
|--|--|--|--|--|--|
|2022-08-04 13:34:00 |2022-08-04 13:37:00 | 2022-08-04 13:34:00| 66.06 |CpuUsage |Mongo |prod|
|2022-08-04 13:34:00|2022-08-04 13:37:00|2022-08-04 13:35:00|68.38|CpuUsage|Mongoprod|
|2022-08-04 13:34:00|2022-08-04 13:37:00|2022-08-04 13:36:00|90.55|CpuUsage|Mongoprod|
Query:
```
from(bucket: "default")
|> range(start: 2022-08-04T05:34:00.000Z, stop: 2022-08-04T05:37:00.000Z)
|> filter(fn: (r) => r["_measurement"] == "Mongo")
|> filter(fn: (r) => r["_field"] == "CpuUsage" and r["service"] == "prod")
|> aggregateWindow(every: 3m, fn: mean, createEmpty: false)
```
Query Result:
|_start|_stop|_time|_value|_field|_measurement|service|
|--|--|--|--|--|--|--|
|2022-08-04 13:34:00|2022-08-04 13:37:00|2022-08-04 13:36:00|67.22|CpuUsage|Mongo|prod|
|2022-08-04 13:34:00|2022-08-04 13:37:00|2022-08-04 13:37:00|90.55|CpuUsage|Mongo|prod|
My Question:
1. With the query string above, I expected one line data, but actual result is two lines.
1. And I want to know the detail about how the func `aggregateWindow` works, I can't get more infomation from influxdb's doc.
1. how the parameter every of `aggregateWindow` split data to windows
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the aggregateWindow query and result shown in the issue, then review the existing aggregateWindow documentation and its description of window boundaries and the every parameter. Document why this query produces two rows and explain how every divides the range. Done means the behavior and parameter semantics are clear to users.
Written by the indexing model from the issue text.
Assessment
- Domain
- databases, documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100