Repository navigation
Show each running job's average duration in the Settings Active processes list - #244
Merged
Merged
Conversation
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.
Summary
(running 3 min · avg 12m 5s).scheduler_run_log.avg_duration_secchanges from an exponential moving average (alpha 0.3) to the plain mean of the job's last 20 successful runs inscheduler_run_history. The Workflow Monitor reads the same column, so both surfaces show one number. Failed runs are excluded; a job with no successful run keeps its previous value.db_helpers.refresh_job_average_duration()is the single calculation: called after every recorded run and once inmigrate_db()so existing moving-average values are replaced at upgrade.GET /api/system/active-jobsgainsactive_job_avg_sec(same keys asactive_jobs,nullwhen no history)._mark_job_started()takes an optionaljob_idso the ETF predictor, Account Price Scraper and Account Auto Top-up jobs, whose names are built per account, resolve their own history; other jobs resolve through their canonical label.constants.SCHEDULER_RUN_HISTORY_LIMIT, used by the history read, the average and the weekly prune.Test plan
pytest tests/test_scheduler_engine.py tests/test_01_database_schema.py tests/test_02_api_get_endpoints.py tests/test_03_api_post_endpoints.py tests/test_accounts_api.py tests/test_accounts_engine.py tests/test_maintenance_engine.py tests/test_risk_orchestrator_engine.py(771 passed)CSS_VERSIONis 5.157 here; Show a Restart pending banner in Settings when the pulled code is newer than the running service #243 sets 5.156, so whichever merges second needs a one-line conflict resolution on that line.