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

chore: add active users counter per rate limiter duration #3150

Conversation

nadezhdapopovaa
Copy link
Contributor

@nadezhdapopovaa nadezhdapopovaa commented Oct 23, 2024

Description:
Add counter for active users based on the rate limiter duration period.

Related issue(s):

Fixes #3151

Notes for reviewer:

Checklist

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

Copy link

github-actions bot commented Oct 23, 2024

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled validates enforcement of request id. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact
Cost: 27,888 ms

Heap Statistics (before vs after executing the test):

  • Total Heap Size: increased with 1.46 MB
  • Total Heap Size Executable: no changes
  • Total Physical Size: decreased with 348.16 KB
  • Total Available Size: decreased with 4.20 MB
  • Total Global Handles Size: no changes
  • Used Global Handles Size: decreased with 64.00 bytes
  • Used Heap Size: decreased with 3.44 MB
  • Heap Size Limit: no changes
  • Malloced Memory: no changes
  • External Memory: no changes
  • Peak Malloced Memory: no changes

Heap Space Statistics (before vs after executing the test):

  • Old Space:

    • Space Size: increased with 1.84 MB
    • Space Used Size: increased with 2.08 MB
    • Space Available Size: decreased with 7.09 MB
    • Physical Space Size: increased with 1.84 MB
  • Large Object Space:

    • Space Size: increased with 835.58 KB
    • Space Used Size: increased with 813.50 KB
    • Space Available Size: no changes
    • Physical Space Size: increased with 835.58 KB

Recommendations

Please investigate the memory allocations in this test, focusing on objects that are not being properly deallocated.

Copy link

github-actions bot commented Oct 23, 2024

Test Results

 19 files  + 2  272 suites  +42   34m 0s ⏱️ + 4m 59s
607 tests ± 0  601 ✅  -  2  4 💤 ±0  2 ❌ +2 
699 runs  +76  693 ✅ +74  4 💤 ±0  2 ❌ +2 

For more details on these failures, see this check.

Results for commit 127fc31. ± Comparison against base commit 264d2cb.

♻️ This comment has been updated with latest results.

@nadezhdapopovaa nadezhdapopovaa force-pushed the 3109-hbar-rate-limit-redesign-add-a-counter-to-expose-dau-metrics branch from c40af15 to 9c52deb Compare October 24, 2024 09:37
@nadezhdapopovaa nadezhdapopovaa self-assigned this Oct 24, 2024
@nadezhdapopovaa nadezhdapopovaa added the enhancement New feature or request label Oct 24, 2024
@nadezhdapopovaa nadezhdapopovaa added this to the 0.59.0 milestone Oct 24, 2024
natanasow
natanasow previously approved these changes Oct 24, 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

@nadezhdapopovaa nadezhdapopovaa marked this pull request as ready for review October 25, 2024 15:02
Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

Good change but not sure it's at the right level and might have side effects

packages/relay/src/lib/services/hbarLimitService/index.ts Outdated Show resolved Hide resolved
packages/relay/src/lib/services/hbarLimitService/index.ts Outdated Show resolved Hide resolved
@ebadiere ebadiere modified the milestones: 0.59.0, 0.60.0 Oct 30, 2024
@nadezhdapopovaa nadezhdapopovaa force-pushed the 3109-hbar-rate-limit-redesign-add-a-counter-to-expose-dau-metrics branch 2 times, most recently from 540fdca to 9ae5db5 Compare November 5, 2024 14:40
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.

Is there a way to have this managed by the metrics service?

@nadezhdapopovaa nadezhdapopovaa force-pushed the 3109-hbar-rate-limit-redesign-add-a-counter-to-expose-dau-metrics branch from 602c959 to d8364e8 Compare November 6, 2024 09:21
Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

I think we've got to an agreement on the metric choice now

packages/relay/src/lib/eth.ts Outdated Show resolved Hide resolved
@nadezhdapopovaa nadezhdapopovaa force-pushed the 3109-hbar-rate-limit-redesign-add-a-counter-to-expose-dau-metrics branch 3 times, most recently from 359ac49 to 07cdacf Compare November 8, 2024 11:52
Nana-EC
Nana-EC previously approved these changes Nov 8, 2024
Copy link
Collaborator

@Nana-EC Nana-EC 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
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! LGTM but left some questions and a suggestion

packages/relay/src/lib/eth.ts Show resolved Hide resolved
packages/relay/src/lib/eth.ts Show resolved Hide resolved
packages/relay/src/lib/eth.ts Outdated Show resolved Hide resolved
packages/relay/src/lib/eth.ts Show resolved Hide resolved
quiet-node
quiet-node previously approved these changes Nov 8, 2024
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! One thing can be addressed in follow PR.

Great work! 🙌🏼

packages/relay/src/lib/eth.ts Outdated Show resolved Hide resolved
@nadezhdapopovaa nadezhdapopovaa force-pushed the 3109-hbar-rate-limit-redesign-add-a-counter-to-expose-dau-metrics branch from 07cdacf to b880663 Compare November 11, 2024 11:12
victor-yanev
victor-yanev previously approved these changes Nov 11, 2024
quiet-node
quiet-node previously approved these changes Nov 11, 2024
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

@quiet-node quiet-node modified the milestones: 0.60.0, 0.61.0 Nov 11, 2024
@nadezhdapopovaa nadezhdapopovaa force-pushed the 3109-hbar-rate-limit-redesign-add-a-counter-to-expose-dau-metrics branch 2 times, most recently from 4d16990 to 720e403 Compare November 12, 2024 14:28
konstantinabl
konstantinabl previously approved these changes Nov 12, 2024
quiet-node
quiet-node previously approved these changes Nov 12, 2024
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 1 question

packages/relay/src/lib/eth.ts Show resolved Hide resolved
@nadezhdapopovaa nadezhdapopovaa force-pushed the 3109-hbar-rate-limit-redesign-add-a-counter-to-expose-dau-metrics branch from 720e403 to 127fc31 Compare November 12, 2024 17:11
Copy link

sonarcloud bot commented Nov 12, 2024

@quiet-node quiet-node modified the milestones: 0.61.0, 0.60.0 Nov 12, 2024
@quiet-node quiet-node merged commit 3dd36f6 into main Nov 12, 2024
42 of 45 checks passed
@quiet-node quiet-node deleted the 3109-hbar-rate-limit-redesign-add-a-counter-to-expose-dau-metrics branch November 12, 2024 23:13
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 77.83%. Comparing base (264d2cb) to head (127fc31).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
packages/relay/src/lib/eth.ts 70.00% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3150      +/-   ##
==========================================
- Coverage   77.85%   77.83%   -0.03%     
==========================================
  Files          66       66              
  Lines        4453     4457       +4     
  Branches      993      998       +5     
==========================================
+ Hits         3467     3469       +2     
  Misses        613      613              
- Partials      373      375       +2     
Flag Coverage Δ
config-service 98.14% <ø> (ø)
relay 78.56% <70.00%> (-0.04%) ⬇️
server 83.28% <ø> (ø)
ws-server 36.66% <ø> (ø)

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

Files with missing lines Coverage Δ
packages/relay/src/lib/eth.ts 71.04% <70.00%> (-0.10%) ⬇️

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
7 participants