Add cron statistics panel for script observability#2989
Draft
Copilot wants to merge 3 commits into
Draft
Conversation
1 task
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Agent-Logs-Url: https://github.com/whyour/qinglong/sessions/3db54913-03d2-4721-b720-8ccbf8d0f00e Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
Agent-Logs-Url: https://github.com/whyour/qinglong/sessions/3db54913-03d2-4721-b720-8ccbf8d0f00e Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add script observation statistics panel
Add cron statistics panel for script observability
Apr 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No way to get a high-level view of script execution health across many tasks — no totals, no trends, no outliers.
Backend
back/data/cronLog.ts— NewCronLogSequelize model (SQLite) storing per-execution records:cron_id,cron_name,start_time(Unix seconds),duration(seconds), indexed on both columnsback/loaders/db.ts— SyncsCronLogtable on startupback/services/cron.ts— Hooks intostatus()to persist aCronLogentry whenever a job transitions toidlewithlast_running_time > 0back/services/cronStats.ts— Statistics service with:stats()— task totals (all/enabled/disabled) + today's execution count and avg durationtrend()— per-day execution counts for the last 7 daystopDuration(5)/topCount(5)— today's slowest and most-frequent tasks with avg/max durationback/api/cron.ts— Four new read-only endpoints:GET /crons/statsGET /crons/stats/trendGET /crons/stats/top-durationGET /crons/stats/top-countFrontend
src/pages/statistics/index.tsx— New page composed of four modules:Notes
Execution success/failure is not tracked yet — the current shell
update_croncall does not propagate an exit code. The schema and service are structured to accommodate that extension without breaking changes.