feat(tui): GPU Platform Stress Test — live nvtop chart during test

Apply the same pattern as NVIDIA SAT: launch nvtop via tea.ExecProcess
so it occupies the full terminal as a live GPU chart (temp, power, fan,
utilisation lines) while the stress test runs in the background.

- Add screenGPUStressRunning screen + dedicated running/render handlers
- startGPUStressTest: tea.Batch(stress goroutine, tea.ExecProcess(nvtop))
- [o] reopen nvtop at any time; [a] abort (cancels context)
- Graceful degradation: test still runs if nvtop is not on PATH
- gpuStressDoneMsg routes result to screenOutput on completion

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mikhail Chusavitin
2026-03-26 10:01:31 +03:00
parent 540a9e39b8
commit 4669f14f4f
6 changed files with 97 additions and 15 deletions

View File

@@ -1,7 +1,6 @@
package tui
import (
"context"
"time"
"bee/audit/internal/platform"
@@ -140,20 +139,7 @@ func (m model) updateConfirm(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
pollSATProgress("gpu-amd", since),
)
case actionRunFanStress:
m.busyTitle = "GPU Platform Stress Test"
m.progressPrefix = "fan-stress"
m.progressSince = time.Now()
m.progressLines = nil
since := m.progressSince
opts := hcFanStressOpts(m.hcMode, m.app)
return m, tea.Batch(
func() tea.Msg {
ctx := context.Background()
result, err := m.app.RunFanStressTestResult(ctx, opts)
return resultMsg{title: result.Title, body: result.Body, err: err, back: screenHealthCheck}
},
pollSATProgress("fan-stress", since),
)
return m.startGPUStressTest()
}
case "ctrl+c":
return m, tea.Quit