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: Add new metrics for spending plans #2932

Merged
merged 31 commits into from
Sep 11, 2024

Conversation

victor-yanev
Copy link
Contributor

@victor-yanev victor-yanev commented Sep 3, 2024

Description:

This PR adds new metrics for spending plans which are tracked dynamically in the HbarLimitService:

  • dailyUniqueSpendingPlansCounter: Tracks the number of unique spending plans used daily. (per subscription type)
  • averageDailySpendingPlanUsagesGauge: Tracks the average daily spending plan usages. (per subscription type)

Related issue(s):

Fixes #2933

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@victor-yanev victor-yanev self-assigned this Sep 3, 2024
@victor-yanev victor-yanev added this to the 0.56.0 milestone Sep 3, 2024
@victor-yanev victor-yanev added the enhancement New feature or request label Sep 3, 2024
@victor-yanev victor-yanev changed the base branch from main to update-cache-client-with-method-for-keys September 3, 2024 11:09
Signed-off-by: Victor Yanev <[email protected]>
Base automatically changed from update-cache-client-with-method-for-keys to main September 5, 2024 16:56
@victor-yanev victor-yanev marked this pull request as ready for review September 5, 2024 19:19
Copy link

github-actions bot commented Sep 5, 2024

Tests

       3 files     274 suites   19s ⏱️
1 285 tests 1 284 ✔️ 1 💤 0
1 297 runs  1 296 ✔️ 1 💤 0

Results for commit 44cc5b6.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Sep 5, 2024

Acceptance Tests

  17 files  220 suites   29m 44s ⏱️
601 tests 594 ✔️ 4 💤 3
624 runs  617 ✔️ 4 💤 3

Results for commit 44cc5b6.

♻️ This comment has been updated with latest results.

@victor-yanev victor-yanev requested review from a team and removed request for ebadiere September 9, 2024 10:26
natanasow
natanasow previously approved these changes Sep 9, 2024
Copy link
Collaborator

@natanasow natanasow left a comment

Choose a reason for hiding this comment

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

LGTM, 2 nits (or questions).

Copy link
Member

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

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

Great work! Left some questions

Signed-off-by: Victor Yanev <[email protected]>
…ns' into add-new-metrics-for-spending-plans

Signed-off-by: Victor Yanev <[email protected]>
Copy link
Member

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

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

LGTM

@ebadiere ebadiere self-requested a review September 10, 2024 21:23
Copy link
Contributor

@ebadiere ebadiere left a comment

Choose a reason for hiding this comment

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

LG.

Copy link

@victor-yanev victor-yanev merged commit 7346b7e into main Sep 11, 2024
43 checks passed
@victor-yanev victor-yanev deleted the add-new-metrics-for-spending-plans branch September 11, 2024 08:46
Copy link

codecov bot commented Sep 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.53%. Comparing base (dc2efa0) to head (44cc5b6).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2932      +/-   ##
==========================================
- Coverage   89.59%   89.53%   -0.06%     
==========================================
  Files          40       56      +16     
  Lines        3056     3794     +738     
  Branches      632      772     +140     
==========================================
+ Hits         2738     3397     +659     
- Misses        274      350      +76     
- Partials       44       47       +3     
Flag Coverage Δ
relay 89.67% <100.00%> (+0.08%) ⬆️
server 88.15% <ø> (?)
ws-server 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...sitories/hbarLimiter/hbarSpendingPlanRepository.ts 100.00% <100.00%> (ø)
...s/relay/src/lib/services/hbarLimitService/index.ts 95.91% <100.00%> (+0.85%) ⬆️

... and 16 files with indirect coverage changes

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

Successfully merging this pull request may close these issues.

[HBAR Rate Limit Redesign] Add new metrics for tracking usage of HBar Spending Plans
4 participants