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

feat: implelemt rate, increase and delta in PromQL #1258

Merged
merged 7 commits into from
Mar 28, 2023

Conversation

waynexia
Copy link
Member

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

  • implement rate() fn
  • implement delta() fn
  • fix increase fn

The current rate of compliance is approximately 37% (⬆️4%).

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

Refer to a related PR or issue link (optional)

Ref to #1042

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
@codecov
Copy link

codecov bot commented Mar 27, 2023

Codecov Report

Merging #1258 (726eae4) into develop (b4fc8c5) will decrease coverage by 0.29%.
The diff coverage is 90.00%.

@@             Coverage Diff             @@
##           develop    #1258      +/-   ##
===========================================
- Coverage    85.54%   85.26%   -0.29%     
===========================================
  Files          495      493       -2     
  Lines        72790    73987    +1197     
===========================================
+ Hits         62269    63085     +816     
- Misses       10521    10902     +381     

Copy link
Contributor

@killme2008 killme2008 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Great work!

src/promql/src/functions/extrapolate_rate.rs Show resolved Hide resolved
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
@waynexia waynexia requested a review from yuanbohan March 28, 2023 06:47
@waynexia waynexia enabled auto-merge (squash) March 28, 2023 06:47
@waynexia waynexia merged commit f491a04 into GreptimeTeam:develop Mar 28, 2023
paomian pushed a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
* clean up

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* fix increase fn

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* impl rate and delta

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* fix typo

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* fix IS_RATE condition

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* more tests about rate and delta

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* ensure range_length is not zero

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants