Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Windowed aggregates #5302

Open
lutter opened this issue Mar 26, 2024 · 2 comments
Open

[Feature] Windowed aggregates #5302

lutter opened this issue Mar 26, 2024 · 2 comments
Labels
area/aggregations enhancement New feature or request

Comments

@lutter
Copy link
Collaborator

lutter commented Mar 26, 2024

Description

Aggregates can be formed either over the current bucket (hour, day) or the entire lifetime of the underlying timeseries. In some cases, it would also be useful to aggregate over a limited window, e.g., the last 6 hours. That could look something like

  recent_max_price: BigDecimal! @aggregate(fn: "max", arg: "price", window: 6)

The current ways to aggregate would be expressed as window: 1 (default) and window: "all" (lifetime/cumulative)

There's a bunch of things that aren't entirely clear:

  • Is it enough if the window is always an integer multiple of the bucket? Or should we offer expressing arbitrary times there, like window: "90 minutes"
  • How would users express that a windowed aggregate should be done for one interval but not the others, e.g., if the above aggregation is done both hourly and daily, how do you express "only add this to the hourly aggregates"
@lutter lutter added enhancement New feature or request area/aggregations labels Mar 26, 2024
@azf20
Copy link
Contributor

azf20 commented Apr 7, 2024

@lutter do you imagine this being updated on every block, or on the hour?

@lutter
Copy link
Collaborator Author

lutter commented Apr 12, 2024

@azf20 It would still only be updated on the hour/day, but would consider data reaching farther back than just that interval

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/aggregations enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants