Rank command providers by recorded cost in a recent time window

Abierto
#755 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
swift

Línea de trabajo

Start with ScriptWidget.record in Sources/StableBar/ScriptWidget.swift, ScriptDiagnostics in Sources/StableBar/ProviderConfiguration.swift, and the Settings → Status overview in Sources/StableBar/DiagnosticsView.swift; read the provider guide for measurement limits. Build a shared, bounded time-window aggregate from reported execution results and show its window, observation period, recorded CPU time, run counts and duration summary. Done means shared providers appear once, expired work drops out, and unavailable or unmeasured work is clearly identified.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement needs-info

Problem

Status already shows cumulative completed-command CPU time and execution counts for each source. Those lifetime totals do not answer which user command provider has cost the most during the same recent period. A source that has run since login cannot be compared fairly with one enabled a few minutes ago, and last-run duration can miss a frequently repeated cheap command.

Users need a recent aggregate comparison of StableBar's own command sources, not another system-wide process monitor or a log of individual runs.

Proposal

Add a recent-cost ranking to the existing Settings → Status overview. Use one clearly labelled time window, such as the last 5 or 15 minutes, and show each command source's recorded completed-command CPU seconds, completed-run count/rate and duration summary for that window.

Use execution results already reported to the runner. Count a shared provider once and identify its consuming widgets. Do not poll the whole process list, add persistent traces, expose a per-run history, or introduce --logs/--follow.

Acceptance
  • All ranked sources use the same recent window, with the window and available observation period shown. Old work stops affecting the ranking once it leaves the window.
  • Ordering by recorded completed-command CPU time lets the user identify the largest recorded recent cost; run count/rate and a duration summary explain frequent or slow commands.
  • A shared provider appears once, regardless of its number of widgets or displays.
  • The UI names the metric “completed-command CPU time,” not live CPU percentage, battery impact or total source cost. Missing/unavailable accounting is explicit rather than presented as measured zero.
  • Long-running streams, native in-process work and deliberately detached descendants are not claimed to be fully measured. A stream's unrecorded live cost is not ranked as zero.
  • The feature needs no whole-process sampling or command stdout/stderr retention. Existing per-widget totals and actions remain available.

Possible today

Existing capability / workaround
  • ScriptWidget.record already accumulates CommandResult.cpuTime.
  • ScriptDiagnostics already exposes counters and duration information. Status technical details shows the cumulative CPU total and counters for one widget at a time.
  • The provider guide explicitly says that CPU time covers completed commands and is not a live meter for a running stream.
  • The performance guide explains measuring the bar and states that commands run in separate processes. Activity Monitor or Instruments can inspect those processes. A user can also take two runtime-query snapshots and compare the cumulative counters manually.

The missing capability is a same-window aggregate ranking of the recorded source costs. It is not generic CPU monitoring.

Reviewed main: 01bf12a1a67f6083342421efa090e48213fbe62e. Latest stable reviewed: 0.17.0. No CPU, battery or execution-cost measurement was performed for this request; no app interaction, build or test was run.

Related

  • #95 / #545 cover published whole-bar performance measurements and their method. They do not rank the user's command providers in the running app.
  • #233 / #234 add the system monitor's app/process CPU and memory list. That system-wide list does not attribute the runner's recorded recent work to shared provider IDs.
  • #307 was declined: the owner said Status and Send Feedback cover most debugging for now. It proposed per-run history, stderr, stream restarts/events/configuration loads, unified logging and --logs/--follow. This request excludes all of those. It is only a bounded recent aggregate of existing execution-cost counters, for comparing sources rather than replaying failures.

Triaged by OMP (closerouter/openai/gpt-6.1-sol).

Lenguaje dominante
Swift
Estrellas
184
Forks
12
Merge medio
3 h 50 min
PR fusionados (30 d)
387

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Seb-GRAF/StableBar

Todos los issues de Seb-GRAF/StableBar

Issues similares

Más issues de Swift

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.