fix(stats): overview polling overlaps ticks, reorders samples and hides errors; one shared polling controller
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Dart
- Star
- 23
- Fork
- 1
- Merge trung bình
- 31 phút
- Pull request đã merge (30 ngày)
- 570
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của QueryaHub/Querya-Desktop
-
enhancement ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
QueryaHub/Querya-Desktop#1689 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowĐang mởbug frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
QueryaHub/Querya-Desktop#1642 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug error-handling settings
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
QueryaHub/Querya-Desktop#1637 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
QueryaHub/Querya-Desktop#1636 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement marketplace
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
QueryaHub/Querya-Desktop#1635 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của QueryaHub/Querya-Desktop
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Not all highlighting kinds have examples in DartColorsAndFontsPageCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởgood-first-issue P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
flutter/dart-intellij-third-party#758 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug: Incorrect location coordinates on logged Sound Meter dataCó thể đã có người làm @Jashan32 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/archive bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
DarkFlippers/qUnleashed#374 ·
Maintainer thường phản hồi trong vòng 1 ngày