Skip to content

Conversation

@dwertent
Copy link
Contributor

Overview

This PR refactors the maybePersistBlockchainEvent() function to return a boolean indicating whether a blockchain event was newly created. This change prevents the double-counting of metrics by ensuring that emitBlockchainEventMetric() is only called for new events.

Fixes #1294.

@dwertent dwertent requested a review from a team as a code owner August 14, 2024 21:20
Copy link
Contributor

@EnriqueL8 EnriqueL8 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 - a few comments

dwertent and others added 3 commits August 15, 2024 10:20
…f the event was created

Signed-off-by: dwertent <david.wertenteil@kaleido.io>
Co-authored-by: Enrique Lacal <enriquelacal@gmail.com>
Signed-off-by: David Wertenteil <david.wertenteil@kaleido.io>
Signed-off-by: dwertent <david.wertenteil@kaleido.io>
Signed-off-by: dwertent <david.wertenteil@kaleido.io>
@dwertent dwertent force-pushed the fix-duplicate-metrics-call branch from 3ea58f8 to 55cf059 Compare August 15, 2024 14:20
@EnriqueL8
Copy link
Contributor

@dwertent just build failing because of the copyright date, we can probably write a small command to update the ones modified

Signed-off-by: dwertent <david.wertenteil@kaleido.io>
@EnriqueL8
Copy link
Contributor

Re-ran the build to upload the code coverage as the repo was deactivated in CodeCov for some reason...

@EnriqueL8
Copy link
Contributor

@dwertent more copyright failures

@codecov
Copy link

codecov bot commented Aug 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (aeec387) to head (a6ae64c).
Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1559   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          325       325           
  Lines        24049     24055    +6     
=========================================
+ Hits         24049     24055    +6     

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

@dwertent
Copy link
Contributor Author

@EnriqueL8 I think we said we would merge this one.

Copy link
Contributor

@EnriqueL8 EnriqueL8 left a comment

Choose a reason for hiding this comment

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

Yeah, good to go!

@EnriqueL8 EnriqueL8 merged commit 74e2cbd into hyperledger:main Aug 29, 2024
@EnriqueL8 EnriqueL8 added this to the v1.3.2 milestone Sep 6, 2024
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.

Blockchain event metrics can be double-counted

2 participants