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 gas/s metric for gas consuming endpoints #939

Merged
merged 9 commits into from
Mar 6, 2023

Conversation

natanasow
Copy link
Collaborator

@natanasow natanasow commented Feb 23, 2023

Description:

Currently, we capture the HBAR spent on gas-consuming calls but we don't capture the actual gas

Note: This may require a mirror node call to view contract results for "Gas Used"
Note 2: Contract calls do not emit records so it's difficult to capture gas used in that case.
Note 3: gas charged = 0.8 * gas limit. Also gas charged >= gas burnt. Example from Danno. "If I did a 35k gas defi trade, the gas limit at 300k, the gas used will be 240k. We should call this "gas charged" even though the EVM only used 35k, "gas burnt."..."

Related issue(s):

Fixes #876

Notes for reviewer:

Checklist

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

Signed-off-by: nikolay <[email protected]>
@natanasow natanasow requested a review from Nana-EC February 23, 2023 10:24
@codecov-commenter
Copy link

codecov-commenter commented Feb 23, 2023

Codecov Report

Patch coverage: 41.17% and project coverage change: -0.16 ⚠️

Comparison is base (9d06877) 74.40% compared to head (d44bd57) 74.24%.

❗ Current head d44bd57 differs from pull request most recent head d725f80. Consider uploading reports for the commit d725f80 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #939      +/-   ##
==========================================
- Coverage   74.40%   74.24%   -0.16%     
==========================================
  Files          28       28              
  Lines        1891     1899       +8     
  Branches      356      360       +4     
==========================================
+ Hits         1407     1410       +3     
- Misses        381      386       +5     
  Partials      103      103              
Impacted Files Coverage Δ
packages/relay/src/lib/clients/sdkClient.ts 21.25% <41.17%> (+0.65%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: nikolay <[email protected]>
Signed-off-by: nikolay <[email protected]>
Signed-off-by: nikolay <[email protected]>
@Nana-EC Nana-EC added enhancement New feature or request P2 labels Feb 24, 2023
@Nana-EC Nana-EC added this to the 0.19.0 milestone Feb 24, 2023
@Nana-EC
Copy link
Collaborator

Nana-EC commented Feb 24, 2023

Please add a description

Signed-off-by: nikolay <[email protected]>
@natanasow natanasow requested a review from Nana-EC February 28, 2023 09:44
packages/relay/src/lib/clients/sdkClient.ts Outdated Show resolved Hide resolved
packages/relay/src/lib/clients/sdkClient.ts Outdated Show resolved Hide resolved
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.

Per other suggestions let's make this clean and have a separate metric.
Preserve the same labels as i believe they are applicable

Signed-off-by: nikolay <[email protected]>
@natanasow natanasow requested review from Nana-EC and AlfredoG87 March 1, 2023 09:06
Nana-EC
Nana-EC previously approved these changes Mar 1, 2023
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.

Looking good, removing block.
Left some final suggestions.
Please get @AlfredoG87 additional sign off before merging.

packages/relay/src/lib/clients/sdkClient.ts Outdated Show resolved Hide resolved
packages/relay/src/lib/clients/sdkClient.ts Outdated Show resolved Hide resolved
Signed-off-by: nikolay <[email protected]>
Signed-off-by: nikolay <[email protected]>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Collaborator

@AlfredoG87 AlfredoG87 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Thank you for addressing all the comments 💯

@natanasow natanasow merged commit 405ea99 into main Mar 6, 2023
@natanasow natanasow deleted the 876-add-gas-metric-for-gas-consuming-endpoints branch March 6, 2023 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P2
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add a gas/s metric for gas consuming endpoints
5 participants