feat: per-stage indexing timings from the optimizations endpoint#152
Open
tellet-q wants to merge 1 commit into
Open
feat: per-stage indexing timings from the optimizations endpoint#152tellet-q wants to merge 1 commit into
tellet-q wants to merge 1 commit into
Conversation
65d1064 to
93336b3
Compare
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
93336b3 to
d8539df
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds per-stage indexing/optimization timing attribution to the existing “wait for green index” phase by reading Qdrant’s REST-only /collections/{collection}/optimizations endpoint, baseline-diffing completed optimization UUIDs, printing a stage breakdown, and persisting the report into the JSON results document.
Changes:
- Introduces a REST-backed
optimizationsmodule that fetches and aggregates optimization progress-tree stage timings with baseline exclusion. - Extends
results.indexto optionally includeoptimizations(per-stage aggregates) alongsidewait_secs. - Adds
--skip-server-statsto disable the REST-only optimization breakdown and updates docs/fixtures accordingly.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/fixtures/optimizations_completed.json | Adds a real-server JSON fixture used to validate parsing and stage aggregation. |
| src/results.rs | Extends IndexPhase to optionally store the optimization-stage report in JSON output. |
| src/optimizations.rs | New module to fetch, baseline-diff, aggregate, and print per-stage optimization timings from Qdrant REST. |
| src/main.rs | Captures optimization baseline before upload, waits for green index, then fetches/prints/stores stage breakdown. |
| src/args/mod.rs | Adds --skip-server-stats flag to disable REST-only extras. |
| README.md | Documents the new per-stage indexing timing output and JSON field location. |
| DEVELOPMENT.md | Updates file layout documentation to include the new optimizations.rs module. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+66
to
+72
| tokio::task::spawn_blocking(move || { | ||
| optimizations::baseline(&rest_uri, &collection, api_key.as_deref()) | ||
| }) | ||
| .await | ||
| .ok() | ||
| .and_then(Result::ok) | ||
| .unwrap_or_default() |
Comment on lines
+276
to
+280
| let agent = ureq::Agent::new_with_defaults(); | ||
| let mut request = agent.get(&url); | ||
| if let Some(key) = api_key { | ||
| request = request.header("api-key", key); | ||
| } |
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.
Indexing was a single number — wait_secs — so a slow index build told you nothing about what was slow. Qdrant already tracks the breakdown; it just isn't exposed over gRPC. This reads it and reports it. No new subcommand, no new workflow. bfb upload and the legacy run already wait for a green index before exiting; that wait now also reports what it cost:
Attribution is baseline-diffed. The server exposes a rolling window of the last 16 completed optimizations, not the ones belonging to your run. So bfb snapshots the completed UUIDs before the phase and excludes them afterwards — otherwise a run would cheerfully report an earlier one's work as its own.
All Submissions:
devbranch. Did you create your branch fromdev?