-
Notifications
You must be signed in to change notification settings - Fork 286
feat(hermes): add staleness histograms for publish→receive and receive→broadcast latencies #2976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
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
…e→broadcast latencies Co-Authored-By: Tejas Badadare <[email protected]>
… async tasks Co-Authored-By: Tejas Badadare <[email protected]>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Link to Devin run: https://app.devin.ai/sessions/ac042ae7c2494cfd92e5d2e7c864274f Requested by: Tejas Badadare |
…t-encoding Co-Authored-By: Tejas Badadare <[email protected]>
Co-Authored-By: Tejas Badadare <[email protected]>
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.
Summary
Adds two new histogram metrics to track staleness/latency in the Hermes price data pipeline:
publish_to_receive_latency_seconds
: Measures time from messagepublish_time
to Hermesreceive_time
(ingestion latency)sse_broadcast_latency_seconds
/ws_broadcast_latency_seconds
: Measures time from Hermesreceive_time
to broadcast over SSE/WebSocket (broadcast latency)Rationale
These metrics help identify bottlenecks and pressure points in Hermes that may be causing OOM issues or slow broadcasts. The first metric tracks how quickly Hermes ingests price data, while the second tracks broadcast delays that could indicate system pressure.
Key implementation decisions:
How has this been tested?
Testing performed:
Changes Made
Aggregate metrics (
src/state/aggregate/metrics.rs
):publish_to_receive_latency
histogramobserve_publish_to_receive()
methodIngestion observation (
src/state/aggregate.rs
):build_message_states()
API metrics (
src/api/metrics_middleware.rs
):sse_broadcast_latency
histogram for SSE broadcastsSSE observation (
src/api/rest/v2/sse.rs
):WebSocket metrics (
src/api/ws.rs
):broadcast_latency
histogramVersion bump:
apps/hermes/server/Cargo.toml
0.10.4 → 0.10.5Review Checklist
publish_time
,received_at
, and current time are all in seconds (casts to f64)received_at
orproof_available_time
isNone
proof_available_time
in SSE path corresponds toreceived_at
conceptuallyAdditional considerations:
Link to Devin run: https://app.devin.ai/sessions/ac042ae7c2494cfd92e5d2e7c864274f
Requested by: Tejas Badadare ([email protected])