fix(stats): overview polling overlaps ticks, reorders samples and hides errors; one shared polling controller
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
Direzione di ricerca
Read the five polling implementations named in the issue, starting with lib/core/motion/ticker_gated_polling.dart and the PostgreSQL and MySQL stats views. Trace how each view starts and stops polling and handles tick results, then add tests with a fake clock for non-overlapping ticks, error backoff and recovery, and polling paused by TickerMode. Done when all five views use the shared controller and those behaviors are covered.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Five Overview/stats screens poll the server with the same copy-pasted code:
| File | Interval | Tick |
|---|---|---|
features/postgresql/postgres_stats_view.dart:185-200 |
5 s | serverStats() |
features/mysql/mysql_stats_view.dart:143-158 |
5 s | serverStats() |
features/redis/redis_view.dart:196-211 |
3 s | INFO |
features/mongodb/mongo_stats_view.dart:168-191 |
3 s default | serverStatus |
features/extensions/extension_stats_view.dart:104-116 |
5 s | JSON-RPC getServerStats |
Each one does Timer.periodic(interval, (_) => unawaited(_onPollTick())) (also in syncTickerGatedPeriodicTimer, lib/core/motion/ticker_gated_polling.dart:23):
- Ticks overlap. A tick does not wait for the previous one. When the server is slow, requests pile up on it exactly when it is struggling. For extension drivers the RPC timeout defaults to 60 s (
extension_driver_session.dart:189-192), so a hung driver collects up to 12 concurrentgetServerStatscalls. - Samples land out of order. Postgres and MySQL append each result to the sparkline history (
_recordHistory) on completion, so overlapping ticks reorder points. - Errors are invisible.
catch (_) {}in every tick: no "stale since" state, no backoff, the dashboard silently freezes on the last good sample. - The timer is started from
build()viasyncTickerGatedPeriodicTimer(a side effect in build), and each view also keeps its own_startTimer.
Fix
One small PollingController (or mixin) in core/motion / core/util:
- self-rescheduling:
await tick()then schedule the next one, so at most one request is in flight; - gated by
TickerMode(keep the current behaviour) andshouldRun; - exponential backoff on errors, last error + last success time exposed as a
ValueListenablefor a "stale" hint; - started and stopped from
didChangeDependencies/dispose, notbuild.
Replace the five copies. Tests with a fake clock: a slow tick never overlaps; errors back off and recover; TickerMode off stops polling.
- Lingua principale
- Dart
- Stelle
- 23
- Fork
- 1
- Merge medio
- 31m
- PR unite (30g)
- 570
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di QueryaHub/Querya-Desktop
-
enhancement ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
QueryaHub/Querya-Desktop#1689 ·
I maintainer di solito rispondono entro 1 giorno
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowApertabug frontend
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
QueryaHub/Querya-Desktop#1642 ·
I maintainer di solito rispondono entro 1 giorno
-
bug error-handling settings
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
QueryaHub/Querya-Desktop#1637 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
QueryaHub/Querya-Desktop#1636 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement marketplace
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
QueryaHub/Querya-Desktop#1635 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di QueryaHub/Querya-Desktop
Issue simili
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
chriskelly/wish-together#36 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AppFlowy-IO/AppFlowy#9075 ·
-
[web] Semantics `lang` attribute uses `Locale.toString()`, producing invalid tags like `es_US`Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Paste asks for iOS paste permission because the default context menu ignores SystemContextMenuForse già presa @dorklein l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
maheshj01/searchfield#267 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
jhomlala/betterplayer#1616 ·
I maintainer di solito rispondono entro 1 giorno