coord/cluster: per-op PUT/GET latency histogram (v0.12 phase 2) - #3
Merged
Conversation
The coordinator times each object PUT and GET from admission to completion
through the seam clock and reports the service time via a new ObserveLatency
hook on coord.Config — success terminals only, since a refused or failed op is
not a service-time sample. internal/cluster wires the hook to a new
hamster_s3_request_duration_seconds{method} histogram (DefaultLatencyBuckets),
the same coord->cluster decoupling the streaming load gauges use: the
coordinator never imports internal/metrics. The GET timing wraps a public
GetEntry boundary over an untimed getEntry worker, so a multipart read is one
sample per client GET, not one per covering part.
ADR-0039 part 1 — the measurement foundation for the minRTT/curRTT gradient and
the limiter. Deterministic and simulator-driven: advancing the sim clock by a
known amount across an op yields exactly that observed duration.
Signed-off-by: Nicholas Phillips <nsphilli@gmail.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.
v0.12 adaptive load shedding — Phase 2 of 5 (ADR-0039 part 1), on top of Phase 1's
metrics.Histogram.The coordinator now times each object PUT and GET from admission to completion through the seam clock, and reports the service time to
internal/clustervia a newObserveLatencyhook oncoord.Config. The cluster wires it to a newhamster_s3_request_duration_seconds{method}histogram (DefaultLatencyBuckets).Design:
internal/metrics; the cluster supplies the callback.minRTT/curRTTwill build on).GetEntryboundary over an untimedgetEntryworker, so a multipart read (which recurses per covering part) is counted once, not per part. VerifiedGetEntryhas no other internal callers.methodlabel (PUT/GET) matches the existinghamster_s3_requests_total{method,code}counter for clean dashboard correlation.Tests (deterministic, sim-driven):
TestLatencyObservedThroughSeamClock(observed seconds == simulated elapsed to the nanosecond, correct label, real histogram snapshot matches) andTestLatencyNotObservedOnError(a failed GET records nothing).task check/build/test+-race+e2egreen.