Memory pressure: the console shows a worker's step
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 74/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- frontend, observability
Hướng nghiên cứu
Start with ui/src/model/fleet.ts, worker-page.ts, and stale-keys.ts; the issue identifies each model seam and the corresponding tests. Read the referenced tests and ui/AGENTS.md first, then run the listed Vitest command. Done means the step appears with its word and tone in the Fleet square and Memory card, the event marks workers stale, and the unit tests and pnpm lint pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Part of #1355.
Scope
An operator sees a worker's memory-pressure step in the console. The Fleet row's square names it, and the worker page's Memory card has a row for it, on a gateway and on a standalone worker alike. A memory.pressure-changed event refreshes what the console shows.
In short
flowchart LR
S[status.get capacity.memoryPressure] --> F[Fleet row square: findings *new word*]
S --> W[worker page Memory card: Paused row *new*]
E[memory.pressure-changed] -->|*new* marks workers stale| S
| Step | Fleet square word and colour | Worker page Memory card row |
|---|---|---|
new-devices-paused |
new devices paused, red |
Paused: new devices (red) |
warming-paused |
warming paused, amber |
Paused: warming (amber) |
none, or no field |
nothing new | no row |
| worker not connected | nothing new: disconnected already wins, as today (ui/src/model/fleet.ts:31) |
no Memory card, as today |
The square still shows the worst finding, and each colour keeps its word. Of two findings with the same colour the square shows the first (F7), so the step's finding goes before the pressure and figure findings: at warming-paused with memory pressure warn the square reads warming paused, and at new-devices-paused with memory pressure critical it reads new devices paused.
If this goes wrong, the console shows a worker as calm while it refuses new devices, or the other way round.
Technical spec
Facts
Commit 6674ad0c.
| # | Fact | Source |
|---|---|---|
| F1 | The Fleet row's findings come from loadFindings: none for a worker not connected; memory pressure warn/critical with tone warn/error |
ui/src/model/fleet.ts:45-65 |
| F2 | The worker page's Memory card takes its tone from the pressure and lists a Pressure detail row |
ui/src/model/worker-page.ts:207-211, ui/src/model/worker-page.ts:233-245 |
| F3 | An event's stale keys come from staleKeys; capacity.changed marks the workers key; no test file covers it |
ui/src/model/stale-keys.ts:18-31, rg -l "staleKeys" ui/src e2e printed only stale-keys.ts and ui/src/state/queries.ts |
| F4 | The Fleet tests cover the square's findings, pressure included | ui/src/model/fleet.test.ts:84 |
| F5 | The console page documents the square's colours and words | website/src/content/docs/docs/worker/console.mdx:104-108 |
| F6 | Colour is never the only signal; orange is never a state | ui/AGENTS.md (Look) |
| F7 | workerHealth keeps the first finding of the worst tone; loadFindings pushes the pressure finding last |
ui/src/model/fleet.ts:19-22, ui/src/model/fleet.ts:46-65 |
Modules touched
Searches: loadFindings, pressureStatus, figureCards, staleKeys, capacity.changed in ui/src.
flowchart LR
SC[screens fleet, worker page] --> ST[state hooks]
ST --> M1[model fleet.ts *]
ST --> M2[model worker-page.ts *]
Q[state queries.ts] --> M3[model stale-keys.ts *]
ui/src/model/fleet.ts: a finding fromworker.capacity?.memoryPressure, placed before the pressure and figure findings (F7).ui/src/model/worker-page.ts: thePauseddetail row on the Memory card.ui/src/model/stale-keys.ts:memory.pressure-changedmarks the workers key; a newui/src/model/stale-keys.test.ts.- Docs: website
worker/console.mdx(the square table),fleet-console.mdxif it lists the words.
Contract and event changes
none: the console reads capacity.memoryPressure (#1361) and memory.pressure-changed (#1361) as types only.
Other code on the same state
Searches: readers of worker.capacity and worker.load.memory in ui/src/model (fleet.ts, worker-page.ts, overview.ts).
overview.tsreads capacity figures for counts only, not the step; unchanged.- The pressure finding (F1) and the step finding can both show; the square takes the worse tone, as today.
- On a gateway, the console sees a new step only after the gateway refreshes that worker's view; until #1364 adds the event to the gateway's refresh list, that is its 30 s tick. Accepted: no Depends on #1364.
- #1145 and #1156 (other features' drafts) edit the
staleKeysswitch andworker-page.ts; whichever lands second rebases. No Depends on: they are not ready.
Failure modes
none: the change crosses no boundary and writes no state.
Rules in play
- ui manual: "Colour is never the only signal"; every new tone carries its word.
- ui manual: "
src/model/has no React and no network, so every rule is a plain unit test." - ui manual: "An event marks keys stale through
src/model/stale-keys.ts."
Tests
The seam is the model builders, modelled on ui/src/model/fleet.test.ts and ui/src/model/worker-page.test.ts.
- An operator's console shows a worker's step on its card and page:
new-devices-pausederror tone with words;warming-pausedwarn tone;warming-pausedbesidememory pressure warnreadswarming paused;new-devices-pausedbesidememory pressure criticalreadsnew devices paused; none nothing. - A
memory.pressure-changedevent marks the console's workers stale: the event marks workers; an unrelated event does not.
Done when
pnpm exec vitest run --project unit ui/src/model/fleet.test.ts ui/src/model/worker-page.test.ts ui/src/model/stale-keys.test.tspasses.pnpm lintpasses.
Out of scope
- A new screen or a chart of the step over time.
Depends on
- #1361
Written by an agent.
- Ngôn ngữ chính
- TypeScript
- Star
- 535
- Fork
- 21
- Merge trung bình
- 9 giờ 10 phút
- Pull request đã merge (30 ngày)
- 454
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của callstackincubator/simlock
-
os:windows request:new
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
callstackincubator/simlock#1071 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
A learned kind keeps one ready copy while its copies are leasedCó thể đã có người làm @V3RON đã nhận hôm nay. Đang mởtask:blocked
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
callstackincubator/simlock#1381 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Warm pool keeps a spare learned copy while its copies are heldCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởfeature:planned
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
callstackincubator/simlock#1374 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
request:new
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
callstackincubator/simlock#1372 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug:new
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 55/100
callstackincubator/simlock#1371 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của callstackincubator/simlock
Issue tương tự
-
ArcGIS Maps SDK for JavaScript c-carousel calcite-design-tokens enhancement impact - p3 - not time sensitive needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Esri/calcite-design-system#15565 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
customer-reported question
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Azure/azure-rest-api-specs#48017 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
microsoft/TypeScript#65370 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
ts-graphviz/ts-graphviz#1904 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày