Build monitor: a stage's memory ignores the samples taken during the stage

Aperta Adatta ai principianti
#283 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
observability

Direzione di ricerca

Inizia da stageMemoryBytes in frontend/lib/microcosm/build-monitor.ts e segui come stageStatistics ricava memory_max_bytes dalle finestre delle fasi. Verifica come recordProgress gestisce gli eventi heartbeat e di avanzamento, poi aggiorna il calcolo della memoria della fase per includere i relativi campioni rss_bytes e usare il valore iniziale o finale quando la finestra non contiene campioni. Il lavoro è completato quando il picco di una fase include campioni raccolti durante tutta la sua finestra.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What happens. The build monitor sets a stage's memory to the larger of the resident memory at its start and at its end: see stageMemoryBytes in frontend/lib/microcosm/build-monitor.ts. stageStatistics then reports the largest of those values across runs as memory_max_bytes. Both span builders hand the events in between (heartbeats and progress events) to recordProgress. That function keeps their work counts and drops their resources.

Why it matters. The emitter attaches a memory sample (current memory, running peak, CPU) to every event, and sends a heartbeat every 60 s by default. The collector stores each sample. So the samples exist, but the monitor shows only a stage's start and end. A stage whose memory rises and falls in between shows less than its peak; an engine materialisation that allocates and frees is one example. The reading is low and nothing marks it.

PolicyEngine/microcosm#931 reads per-stage peaks to choose which UK spine stages need a memory guard at 15 clones, so those stages could be missed.

Ask.

  • Take a stage's memory as the largest rss_bytes over every sample in its window: its start, each heartbeat and progress event within it, and its end.
  • Fall back to the start-or-end value only when no event in the window carries a sample.

Neither the emitter nor the collector needs to change, since both already carry every sample.

Lingua principale
TypeScript
Stelle
0
Fork
5
Merge medio
1g 16h
PR unite (30g)
36

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PolicyEngine/calibration-diagnostics

Tutte le issue di PolicyEngine/calibration-diagnostics

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.