- Load, CPU pressure, RAM pressure and swap tiles (System page and home rail) are amber/red exactly when the verdict names them; `SystemHealth` rules are now functions both use. - Builds tile reads `1 of 2 running`: amber with one slot free, red with none (with one slot amber even when idle). - `GET /api/system` carries `maxConcurrent` (slots in force). - Disk pressure stays uncoloured (RFC 0004). PR-doc: `docs/prs/2026-10-03-PR#101-tile-levels.md` 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: mhoennig <michael@hoennig.de> Reviewed-on: #101
3.3 KiB
WARNING: This document describes only the change applied in this PR. It may already be outdated once the next PR is merged. Historic PR-documentation is not maintained along with new PRs — treat it as a snapshot, not as current documentation.
The Problem
The System page and the home page colour the gauges, and since PR#100 the swap tile. The other tiles stayed plain: load, CPU pressure, RAM pressure, and the builds tile. The verdict above them could say "under pressure" because of the load, and no tile showed which one it meant. The builds tile said how many builds ran, not how many could, so a full executor looked like an idle one.
Non-Goals
- No new thresholds and no configuration: the tiles take the verdict's rules, which are not host-dependent.
- Disk pressure stays uncoloured: RFC 0004 collects it without judging it, because on a shared host it measures the neighbours first.
The Scenarios
Feature: The tiles take the verdict's colours
Scenario#101.01: Load and pressure tiles are coloured by the verdict's own rules
So that a tile is amber or red exactly when the verdict names it.
- Given snapshots on the calm side of every threshold, at the pressure thresholds, and at the overload thresholds
- When the System page and the home rail render them
- Then the tiles are calm, amber (load above the threads, CPU pressure from 20 %, RAM pressure from 2 %, swap at half its size), and red (load at twice the threads, RAM pressure from 10 %)
- And CPU pressure never turns red, and disk pressure never changes colour
Verified by
- UiViewsUnitTest — Scenario#101.01
Scenario#101.02: The builds tile is amber with one slot free and red with none
So that a full executor stands out, and a single slot reads as the tight setting it is.
- Given an executor with three slots, and one with a single slot
- When builds run
- Then the tile is amber with one slot free and red with none
- And with a single slot it is amber even while idle
- And it reads
2 of 2 running
Verified by
- UiViewsUnitTest — Scenario#101.02
Scenario#101.03: The system endpoint carries the slots
So that werkator.js judges the polled builds tile like the server.
- Given an executor with two slots
- When
GET /api/systemis called - Then it answers
maxConcurrent: 2
Verified by
- SystemApiControllerRestTest — Scenario#101.03
The Solution
SystemHealthkeeps its rules inloadLevel,cpuPressureLevel,memoryPressureLevelandswapRatioLevel;assessand the tiles both use them.UiFormats.tileLevelturns a level into the tile's class,UiFormats.buildSlotsLeveljudges the free slots;werkator.jshas the twins and the thresholds.BuildExecutor.maxConcurrentanswers the slots in force —executor.maxConcurrenttakes effect only with a restart — and the configured value before the first build.GET /api/systemcarriesmaxConcurrent; the builds tile reads1 of 2 running.werkator.csscolours alevel-crittile red, like alevel-warntile amber.
Additional Changes
- Version 1.32.0 with its release note.