Skip to content

read cost M2: where the time went — serve the doctor report, and one panel line for the person waiting #421

Closed

Description

@lex00

M2 of #419. Depends on M1.

What

src/doctor.ts produces a report (diagnose, formatReport) and only the CLI ever asks for it. There is no /api/doctor. memberIrCacheStats() has returned hits, misses and entries since it was written, with a comment calling it "cheap enough to expose for a future /api/doctor line", and nothing but its own test has ever called it.

Someone watching behold take two minutes has nowhere to look.

Do

Serve the doctor report, and put M1's numbers and the member IR cache stats on it: what is queued now, what is running, what the last read of each member cost, and the source-versus-live split.

Then give the panel one line of it. The full report is for a person diagnosing; the panel line is for a person waiting, and they want different things. src/frames.ts and the operator strip are the nearest precedent for a small always-visible status line that does not need its own tab.

Respect the existing refusal shapes: preview mode and a static-export capture do not get a live cost line, for the same reason they do not get a write.

Proof

/api/doctor answers with the existing report plus the read numbers. A route test that it reports a read in flight while one is in flight. The panel line shows a real cost after a workbench read.

Refs #419.

Metadata

Metadata

Assignees

No one assigned

    Labels

    read-cost

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions