Skip to content

Read Host health and inventory summaries without loading detail rows - #356

Merged
bliatun-code merged 1 commit into
mainfrom
codex/compact-host-summary
Dec 1, 2026
Merged

bliatun-code merged 1 commit into
mainfrom
codex/compact-host-summary

Conversation

@bliatun-code

Copy link
Copy Markdown
Owner

Summary

Host health and the library snapshot now read the library ID, mode and device name directly. The snapshot counts printers in SQLite and counts active outbound loans using the same joins and eligibility rules as the detailed loan list. The snapshot still reads its inventory overview, optional Dashboard stock and counts in one read transaction.

The API regression exercises health plus the ordinary and Dashboard snapshots after injecting unreadable detail-only fields into printer, loan and client validation records. It checks normalized identity, legacy direction spelling, returned loans, deleted spools and the optional Dashboard projection.

Local comparison

Median elapsed time to construct the ordinary Host snapshot in the debug build, on the same synthetic SQLite database, with alternating implementations and 11 measured samples per implementation after warm-up. Excludes HTTP and rendering.

Synthetic library Before After
Empty inventory, loans and printers 1.17 ms 1.08 ms
10,000 spools, 10,000 active outbound loans, 25 printers with 16 slots each 100.30 ms 33.93 ms

Verification

  • npm run verify
  • npm run check:public-readiness
  • cargo test -p bambu-filament-manager host_health_and_summary_are_independent

@bliatun-code
bliatun-code merged commit 4cb66c4 into main Dec 1, 2026
10 checks passed
@bliatun-code
bliatun-code deleted the codex/compact-host-summary branch December 1, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant