Runtime Payload Histogram Tracking#3191
Open
YiwenZhang12 wants to merge 9 commits intovalkey-io:unstablefrom
Open
Runtime Payload Histogram Tracking#3191YiwenZhang12 wants to merge 9 commits intovalkey-io:unstablefrom
YiwenZhang12 wants to merge 9 commits intovalkey-io:unstablefrom
Conversation
added 7 commits
February 11, 2026 15:49
Signed-off-by: Yiwen Zhang <yiwen_zhang@apple.com>
Signed-off-by: Yiwen Zhang <yiwen_zhang@apple.com>
Signed-off-by: Yiwen Zhang <yiwen_zhang@apple.com>
Signed-off-by: Yiwen Zhang <yiwen_zhang@apple.com>
Signed-off-by: Yiwen Zhang <yiwen_zhang@apple.com>
Signed-off-by: Yiwen Zhang <yiwen_zhang@apple.com>
Signed-off-by: Yiwen Zhang <yiwen_zhang@apple.com>
b614808 to
9146f3d
Compare
Signed-off-by: Yiwen Zhang <yiwen_zhang@apple.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #3191 +/- ##
============================================
- Coverage 74.96% 74.88% -0.09%
============================================
Files 129 130 +1
Lines 71318 71550 +232
============================================
+ Hits 53467 53583 +116
- Misses 17851 17967 +116
🚀 New features to boost your workflow:
|
Signed-off-by: Yiwen Zhang <yiwen_zhang@apple.com>
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.
Motivation
Today, operators lack a bounded and structured way to understand real traffic payload distributions (small vs large requests/replies). Existing signals such as buffer sizes or isolated counters do not provide insight into distribution shape or proximity to configured limits.
This proposal introduces a time bounded, sampling aware payload tracking mechanism that allows operators to temporarily quantify traffic size distributions without permanently expanding the server’s metrics surface area.
The design intentionally avoids always on instrumentation and keeps steady state overhead at zero when disabled.
Design Principles
Command Surface
PAYLOAD TRACKINGControls runtime data collection.
Defaults:
Tracking automatically expires after the configured duration.
STATUSreports:Invalid/expired state reports cleanly.
STATUS Example
PAYLOAD HISTOGRAMReturns per view bucket distributions.
RESET clears accumulated samples for a new observation window.
Bucketing Model
Each configured view represents a base payload size.
Buckets grow multiplicatively by payload-histogram-factor.
Runtime Config
payload-histogram-viewsDefault: 32kb 64kb 128kb 256kb 512kb
payload-histogram-factorDefault: 2
payload-tracking(bool)Global enable/disable guard.
Buckets are non cumulative. Output includes:
calls: total recorded sampleshistogram_bytes: upper-bound → count pairsThis keeps memory bounded and predictable.
Operational Example
Tracks read payload sizes for 120 seconds, sampling 1 out of every 10 commands.
Clears counters for a fresh observation window.
Returns per-bucket distribution for sampled reads.
Example:
Explanation:
In this example:
Performance & Overhead
When tracking is OFF:
No additional instrumentation executed on command path.
When ON:
Overhead is proportional to sampling rate and duration.
Memory usage is bounded by:
Number of configured views
Multiplicative bucket expansion factor