gabriel / musehub public
feat patch bundle dev
AI Agent gabriel · 124 days ago · May 11, 2026 · Diff

feat(bundle): Phase 4 observability — per-phase timing in return dict and summary log

process_bundle_index_job now emits and returns a full timing breakdown:

Return dict additions: bundle_size_bytes — raw wire bytes (correlates timing against bundle size) fetch_bundle_ms — MinIO GET (network round-trip, critical path indicator) unpack_ms — msgpack.unpackb (CPU-bound, O(bundle_size)) snapshot_insert_ms — bulk INSERT musehub_snapshots commit_insert_ms — bulk INSERT musehub_commits object_puts_ms — parallel MinIO PUTs (network-bound, batched 200-wide) object_insert_ms — bulk ON CONFLICT DO UPDATE musehub_objects object_refs_ms — upsert musehub_object_refs

Summary log now emits all phase labels in one line so dashboards and grep can consume a single record per job rather than reassembling seven lines: ✅ [bundle.index] done in 82.0ms fetch_bundle=5.2ms unpack=1.1ms ...

Split t_loaded into t_fetched (after MinIO GET) + t_loaded (after unpackb) so fetch_bundle_ms and unpack_ms are measured independently.

TDD: test_bundle_index_job_phase4.py — 5 tests, all green.

sha256:747fb3cb717d92b53cade56ad9439905b5638cb75cfa62b087cfe58c0b158d71 sha
+42 ~1 symbols
sha256:526f0c824acb37e10cc90a2068a1884050ff6596e61d2cc2654a3cdbe241fc45 snapshot
+42
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes 43 symbols
~ tests/test_bundle_index_job_phase4.py .py 42 symbols added
+ _AUTH_CTX variable variable _AUTH_CTX L52–57
+ _BLOB_SIZE variable variable _BLOB_SIZE L62–62
+ _FILES_CHANGED variable variable _FILES_CHANGED L61–61
+ _N_COMMITS variable variable _N_COMMITS L60–60
+ _N_FILES variable variable _N_FILES L59–59
+ _PHASE_TIMING_KEYS variable variable _PHASE_TIMING_KEYS L65–73
+ _make_repo function function _make_repo L108–165
+ _push_bundle function async_function _push_bundle L168–198
+ client function async_function client L79–93
+ ASGITransport import import ASGITransport L31–31
+ AsyncClient import import AsyncClient L31–31
+ AsyncSession import import AsyncSession L32–32
+ CommitRecord import import CommitRecord L42–42
+ MSignContext import import MSignContext L34–34
+ SnapshotRecord import import SnapshotRecord L42–42
+ annotations import import annotations L21–21
+ app import import app L36–36
+ blob_id import import blob_id L49–49
+ build_mpack import import build_mpack L39–39
+ compute_commit_id import import compute_commit_id L41–41
+ compute_snapshot_id import import compute_snapshot_id L41–41
+ datetime import import datetime L23–23
+ get_db import import get_db L35–35
+ hashlib import import hashlib L24–24
+ logging import import logging L25–25
+ msgpack import import msgpack L28–28
+ muse_dir import import muse_dir L40–40
+ optional_signed_request import import optional_signed_request L34–34
+ pathlib import import pathlib L26–26
+ pytest import import pytest L29–29
+ pytest_asyncio import import pytest_asyncio L30–30
+ require_signed_request import import require_signed_request L34–34
+ write_branch_ref import import write_branch_ref L42–42
+ write_commit import import write_commit L42–42
+ write_object import import write_object L38–38
+ write_snapshot import import write_snapshot L42–42
+ repo function async_function repo L97–105
+ test_all_phase_timings_are_non_negative function async_function test_all_phase_timings_are_non_negative L227–246
+ test_bundle_size_bytes_in_return_dict function async_function test_bundle_size_bytes_in_return_dict L250–273
+ test_phase_timings_sum_within_elapsed function async_function test_phase_timings_sum_within_elapsed L277–301
+ test_return_dict_has_per_phase_timing_keys function async_function test_return_dict_has_per_phase_timing_keys L204–223
+ test_summary_log_contains_phase_breakdown function async_function test_summary_log_contains_phase_breakdown L305–340
← Older Oldest on dev
All commits
Newer → Latest on dev

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:747fb3cb717d92b53cade56ad9439905b5638cb75cfa62b087cfe58c0b158d71 --body "your comment"