chore: Extend byte counters with a total amount of bytes since creation - #26933
Open
abies wants to merge 1 commit into
Open
chore: Extend byte counters with a total amount of bytes since creation#26933abies wants to merge 1 commit into
abies wants to merge 1 commit into
Conversation
Signed-off-by: Artur Biesiadowski <artur.biesiadowski@swirldslabs.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #26933 +/- ##
============================================
+ Coverage 70.47% 70.53% +0.05%
- Complexity 11685 11689 +4
============================================
Files 2586 2586
Lines 108464 108474 +10
Branches 12141 12141
============================================
+ Hits 76444 76510 +66
+ Misses 28037 27980 -57
- Partials 3983 3984 +1
... and 18 files with indirect coverage changes 🚀 New features to boost your workflow:
|
✅ All tests passed ✅🏷️ Commit: 705bb15 Learn more about TestLens at testlens.app/docs. |
| public class FastByteCounter implements ModifiableByteCounter { | ||
|
|
||
| private long count; | ||
| private long resetSoFar; |
Contributor
There was a problem hiding this comment.
i would suggest calling it something like historicValue or nonResetValue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Possibility of retrieving the number of bytes read/written by a connection without stepping on the toes of metrics.
Proper way to do that would be probably redesigning metrics to NOT reset the counter, but hold a local copy of the last read count, it is a bigger change, and given that metrics are redesigned anyway, probably future work.
It is needed to implement per-connection throttling for sync/broadcast (#18762)
Related issue(s):
Fixes #26930
Checklist