fix(stats): overview polling overlaps ticks, reorders samples and hides errors; one shared polling controller
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 42/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Dart
- Estrelas
- 23
- Forks
- 1
- Merge médio
- 31min
- PRs com merge (30d)
- 570
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de QueryaHub/Querya-Desktop
-
enhancement ui
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
QueryaHub/Querya-Desktop#1689 ·
Mantenedores costumam responder em até 1 dia
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowAbertabug frontend
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
QueryaHub/Querya-Desktop#1642 ·
Mantenedores costumam responder em até 1 dia
-
bug error-handling settings
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 78/100
QueryaHub/Querya-Desktop#1637 ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
QueryaHub/Querya-Desktop#1636 ·
Mantenedores costumam responder em até 1 dia
-
enhancement marketplace
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
QueryaHub/Querya-Desktop#1635 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de QueryaHub/Querya-Desktop
Issues semelhantes
-
agent:in-progress agent:ready feature P2 · 中 区域: 悬浮窗
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
ASDW51/DanmuFloat#178 ·
Mantenedores costumam responder em até 1 dia
-
Missing workoutsAbertaenhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
InlitX/GymMane#237 · 1 comentário ·
Mantenedores costumam responder em até 5 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
AppFlowy-IO/AppFlowy#9077 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Abhinivesh2729/Thinai#41 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
0niel/university-app#617 ·
Mantenedores costumam responder em até 1 dia