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

Add a Redis cache to the REST API #8187

Merged
merged 3 commits into from Apr 29, 2024
Merged

Add a Redis cache to the REST API #8187

merged 3 commits into from Apr 29, 2024

Conversation

steven-sheehy
Copy link
Member

@steven-sheehy steven-sheehy commented Apr 26, 2024

Description:

  • Add a Redis cache to /api/v1/transactions
  • Add Redis configuration to REST chart
  • Remove temporary snyk Gradle plugin workaround

Related issue(s):

Fixes #8000

Notes for reviewer:

Before

URL VUS Pass% Pass RPS Avg. Req Duration
/transactions?limit=100 1500 100.00 619.50/s 2392.61ms
/transactions?account.id=1833905&limit=100 1500 100.00 575.79/s 2575.99ms
/transactions?transactionType=CRYPTOTRANSFER&limit=100&order=asc 1500 100.00 552.42/s 2676.92ms

After

URL VUS Pass% Pass RPS Avg. Req Duration
/transactions?limit=100 1500 100.00 942.86/s 1556.75ms
/transactions?account.id=1833905&limit=100 1500 100.00 869.74/s 1693.94ms
/transactions?transactionType=CRYPTOTRANSFER&limit=100&order=asc 1500 100.00 769.37/s 1909.90ms

Checklist

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

Signed-off-by: Steven Sheehy <steven.sheehy@swirldslabs.com>
@steven-sheehy steven-sheehy added enhancement Type: New feature performance rest Area: REST API labels Apr 26, 2024
@steven-sheehy steven-sheehy added this to the 0.104.0 milestone Apr 26, 2024
@steven-sheehy steven-sheehy self-assigned this Apr 26, 2024
Copy link

codecov bot commented Apr 26, 2024

Codecov Report

Attention: Patch coverage is 84.48276% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 92.24%. Comparing base (f70bc44) to head (22b7d3a).

Files Patch % Lines
hedera-mirror-rest/cache.js 89.36% 5 Missing ⚠️
hedera-mirror-rest/transactions.js 60.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8187      +/-   ##
============================================
- Coverage     92.26%   92.24%   -0.02%     
  Complexity     7263     7263              
============================================
  Files           897      898       +1     
  Lines         29244    29297      +53     
  Branches       3559     3568       +9     
============================================
+ Hits          26981    27025      +44     
- Misses         1448     1456       +8     
- Partials        815      816       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@steven-sheehy steven-sheehy marked this pull request as ready for review April 26, 2024 20:01
@steven-sheehy steven-sheehy requested a review from a team April 26, 2024 20:01
jascks
jascks previously approved these changes Apr 26, 2024
Copy link
Member

@jascks jascks left a comment

Choose a reason for hiding this comment

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

LGTM

jnels124
jnels124 previously approved these changes Apr 29, 2024
Copy link
Contributor

@jnels124 jnels124 left a comment

Choose a reason for hiding this comment

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

LGTM

mgoelswirlds
mgoelswirlds previously approved these changes Apr 29, 2024
Copy link
Member

@mgoelswirlds mgoelswirlds left a comment

Choose a reason for hiding this comment

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

LGTM

edwin-greene
edwin-greene previously approved these changes Apr 29, 2024
Copy link
Contributor

@edwin-greene edwin-greene left a comment

Choose a reason for hiding this comment

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

Looks good

xin-hedera
xin-hedera previously approved these changes Apr 29, 2024
Copy link
Collaborator

@xin-hedera xin-hedera left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Steven Sheehy <steven.sheehy@swirldslabs.com>
Signed-off-by: Steven Sheehy <steven.sheehy@swirldslabs.com>
Copy link

sonarcloud bot commented Apr 29, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Collaborator

@xin-hedera xin-hedera left a comment

Choose a reason for hiding this comment

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

LGTM

@steven-sheehy steven-sheehy merged commit 12f1570 into main Apr 29, 2024
30 of 31 checks passed
@steven-sheehy steven-sheehy deleted the 8000-rest-cache branch April 29, 2024 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type: New feature performance rest Area: REST API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cache list transactions
6 participants