Emit throttle metrics#42
Open
forge33 wants to merge 6 commits into
Open
Conversation
Use a single metrics emitter abstraction for gauge, count, and histogram samples so metric helpers share one testable client contract.
c148501 to
fab54df
Compare
8aff79e to
aa3774f
Compare
aec0681 to
4528c12
Compare
Keep the small metric emission helpers, runtime reporter, and their tests together so the metrics package has fewer one-function files.
aa3774f to
63e4992
Compare
4528c12 to
2beb2ce
Compare
grodowski
approved these changes
Jun 2, 2026
| } | ||
|
|
||
| func (thlr *Throttler) recordThrottleMetrics(alreadyThrottling bool, shouldThrottle bool, throttleReason string, now time.Time) { | ||
| metrics.EmitThrottleActiveGauge(thlr.migrationContext.Metrics, shouldThrottle) |
Member
There was a problem hiding this comment.
Might want to add debounce here so we don't call this every 100ms?
Record throttle active state at a debounced cadence and emit duration plus event metrics when a throttled interval completes.
2beb2ce to
a201553
Compare
2 tasks
bd9bdb1 to
c4e2b06
Compare
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.
Related issue: github#1672
Closes: https://github.com/Shopify/schema-migrations/issues/5456
Description
gh_ost.throttle.activeon each throttler check tick.gh_ost.throttle.duration_secondsandgh_ost.throttle.events_totalonce per completed throttle interval.🎩
script/cibuildreturns with no formatting errors, build errors or unit test errors.