You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publish metrics only when actually publishing (#227)
### TL;DR
Moved metrics collection from the Committer to the Publisher for more accurate timing and consolidated metrics reporting.
### What changed?
- Removed metrics collection for publishing duration from the Committer's goroutine
- Moved the timing measurement for publishing to the Publisher itself
- Consolidated all metrics reporting (block counter, last published block, reorg counter) to happen in one place within the Publisher
- Fixed a bug where reorg metrics were only being recorded for old blocks, not new blocks
### How to test?
1. Run the application and verify that metrics are still being reported correctly
2. Check that the publish_duration metric now accurately reflects the actual time spent in the Publisher.PublishBlockData method
3. Verify that reorg metrics are properly recorded when a reorg occurs
### Why make this change?
The previous implementation had inaccurate timing measurements since the metrics were being recorded in the Committer's goroutine rather than in the Publisher itself. This change ensures that the publish_duration metric accurately reflects the actual time spent publishing data. Additionally, consolidating all metrics reporting in one place makes the code more maintainable and ensures consistent metrics collection.
0 commit comments