feat: add bytesMissed cache counter and blob download driver metrics#1709
Conversation
🦋 Changeset detectedLatest commit: 1d11fb7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Code Review
This pull request introduces a new optional field missedBytes to the CacheCounters type in http_helpers.ts to track bytes requested by clients that were not cached, allowing for the measurement of read-ahead amplification against bytesFetched. A corresponding changeset file has also been added to document this change. There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1709 +/- ##
===========================================
+ Coverage 44.56% 55.30% +10.73%
===========================================
Files 43 313 +270
Lines 2540 17610 +15070
Branches 663 3836 +3173
===========================================
+ Hits 1132 9739 +8607
- Misses 1225 6636 +5411
- Partials 183 1235 +1052 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Tracks bytes requested by clients that were not cached, distinct from bytesFetched (which includes read-ahead and read-behind). The ratio of the two measures read-ahead amplification for tuning the cache.
Add BlobDriverMetrics and DownloadDriver.getMetrics() exposing: - uncached (sparse-cache-bypass) request count and bytes streamed - live in-flight download gauges (count, total/received bytes) - presigned-URL cache efficiency (hits, misses, stale hits, fetch latency) Reported separately from the serv cache metrics so the two evolve on their own release cadences; a monitoring panel composes both.
2c2e6ae to
2760ae1
Compare
CREATE_PLUGIN_MODEL used a unique Symbol(), so a PluginInstance created against one copy of @platforma-sdk/model and a block consuming it against another copy (separate-package plugins, bundled-vs-externalized model in block-tools build-model, pnpm peer-hash duplicates) keyed the handshake method under different symbols -> instance[CREATE_PLUGIN_MODEL] undefined. Use Symbol.for() so every copy resolves the same global-registry symbol.
What
Two related observability additions for blob caching/downloading:
1.
bytesMissedon the serv cache counters (CacheCounters)Bytes requested by clients that were not cached. Compared with
bytesFetched(downloaded incl. read-ahead/behind), the ratiobytesFetched / bytesMissedis read-ahead amplification — the signal for tuning the read-ahead window. Optional for now so producers typed against the published model stay assignable; serv emits it later.2.
BlobDriverMetrics+DownloadDriver.getMetrics()Reported separately from the serv cache metrics — different owners and release cadences — so a monitoring panel composes both rather than one nesting the other.
RemoteBlobProviderImpluntouched.Notes
uncachedRequestBytescounts bytes actually streamed off the wire, not nominal request size.