Skip to content

feat(reports): support bounded live experiment monitoring - #52

Open
marcfranquesa wants to merge 2 commits into
mainfrom
feat/live-monitoring
Open

marcfranquesa wants to merge 2 commits into
mainfrom
feat/live-monitoring

Conversation

@marcfranquesa

@marcfranquesa marcfranquesa commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Growing experiment logs previously failed after 10,000 rows and were fully embedded in every live response. Stream and validate the complete CSV prefix while retaining bounded report data: at most 512 sampled rows per plot and the latest 100 recorded rows per table. Samples preserve endpoints and extrema; per-series discontinuity flags prevent lines bridging omitted missing values. Original logs remain untouched, and static builds remain self-contained.

Live viewing now waits for complete newline-terminated records, caches bounded projections, and sends conditional 304 responses after fresh validation. Stable cache admission preserves a warm subset when catalogs exceed capacity. Appends and continuing atomic replacement preserve inspection by x, focus, disclosure, and scroll; invalid completed data keeps the last valid page until recovery. Changed logs still require a full streaming scan.

Extend the existing report guide and CLI help with the schema, limits, sampling/table behavior, failure handling, complete-row/flushing recipes, atomic restarts/publishing, and local/SSH setup. Remove full-history buffering, the row-count rejection, redundant raw-table trimming/fallbacks, unused table break metadata, and FIFO cache bookkeeping. No new dependencies.

Validation:

  • Full go test -race ./..., go vet ./..., JavaScript syntax, and git diff --check pass.
  • Deterministic regressions cover large and million-row sparse logs, sampling invariants, repeated refreshes, partial/quoted/CRLF records, appends, replacement, truncation/restarts, invalid-data recovery, source precedence, confinement, cache overflow, and layout changes.
  • Node behavior probes and actual browser checks cover conditional polling, deferred graph updates, selection/focus/scroll recovery, bounded SVG/table counts, aligned plots, and mobile layout. Offline build and documentation/help generation pass; both Python logging recipes execute successfully.
  • Three separate timing batches and a separate heap observation use a verified unchanged source fingerprint. At 1m rows (27.9 MB CSV), median parse is 284 ms, append HTTP refresh 292 ms, unchanged HTTP refresh 0.44 ms with zero body bytes, and HTML is 74,421 bytes. Sampled Go heap peaks around 4 MB (not RSS); the rendered report has 1,907 elements, including two 100-row tables. Single-experiment timings do not imply constant catalog-scale costs.

Benchmark medians on Apple M5 Max / macOS / Go 1.27.1, from three process runs of three operations per case:

Rows Parse ms Append HTTP ms Unchanged HTTP ms Peak sampled Go heap MB HTML bytes Report DOM elements
10k 4.803 4.816 0.447 3.79 75,377 2,163
100k 29.242 30.418 0.441 3.94 76,066 2,168
1m 284.248 291.713 0.438 3.98 74,421 1,907

Unchanged responses were 304 with zero body bytes. Heap observation runs separately from timing and measures Go heap rather than RSS; generated input fixtures stay outside Git. Reports each contain two 100-row raw tables. Timing thresholds are excluded from deterministic regression tests. The experiment record and root project config are excluded from the repository; the Go benchmark tests remain reproducible directly:

go test -count=1 -run '^$' -bench '^BenchmarkMonitor' -benchtime 3x -benchmem ./internal/report ./internal/cli
EXPLEDGER_MONITOR_MEMORY=1 go test -count=1 -run '^TestMonitorMemory$' -v ./internal/cli

Repeat the timing command three times with unchanged source. Both commands construct temporary projects without a checked-in experiment or root config.

This branch has not been deployed

No deployments
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