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] Support gauge_agg accessor function RATE #1391

Closed
yukkit opened this issue Jul 28, 2023 · 0 comments
Closed

[Feature] Support gauge_agg accessor function RATE #1391

yukkit opened this issue Jul 28, 2023 · 0 comments
Assignees
Labels
component/function component/query documentation Improvements or additions to documentation good first issue Good for newcomers
Milestone

Comments

@yukkit
Copy link
Contributor

yukkit commented Jul 28, 2023

Is your feature request related to a problem? Please describe.
Calculate the rate of change of the gauge_agg. This is the simple rate, equal to the last value minus the first value, divided by the time elapsed.

The unit of time_delta is determined by the time unit of the time column:

time_delta time column
ms s
ms
ns us
ns

Describe the solution you'd like

  • Syntax
RATE(<GaugeAgg>): <rate value>
  • arguments
GaugeAgg: The result of aggregate function GaugeAgg, see https://github.com/cnosdb/cnosdb/issues/1365
  • returns
rate value: The data type is consistent with the argument 'gauge' in 'GaugeAgg' func.

Describe alternatives you've considered

Add to https://github.com/cnosdb/cnosdb/tree/main/query_server/query/src/extension/expr/scalar_function

Additional context

The mainstream database supports RATE show below:

timescaledb
https://docs.timescale.com/api/latest/hyperfunctions/counters-and-gauges/gauge_agg/#rate

@yukkit yukkit added documentation Improvements or additions to documentation good first issue Good for newcomers component/query component/function labels Jul 28, 2023
@yukkit yukkit added this to the V2.4.0 milestone Jul 28, 2023
@yukkit yukkit self-assigned this Aug 2, 2023
@yukkit yukkit assigned Benxiaohai001 and unassigned yukkit Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/function component/query documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants