feat: implement completed task tracking in StatusManager#326
Open
nuthalapativarun wants to merge 1 commit intomicrosoft:pre-releasefrom
Open
feat: implement completed task tracking in StatusManager#326nuthalapativarun wants to merge 1 commit intomicrosoft:pre-releasefrom
nuthalapativarun wants to merge 1 commit intomicrosoft:pre-releasefrom
Conversation
get_task_statistics() always returned zeroes for completed_tasks, success_rate, and average_execution_time because no tracking existed (left as a TODO comment). Add: - _completed_tasks / _failed_tasks dicts keyed by task_id - record_task_completion(task_id, success, execution_time) method for callers to register outcomes - Updated get_task_statistics() to compute real success rate and average execution time from the recorded data - failed_tasks counter exposed in the statistics dict
Author
|
Hi team — gentle ping on this PR. Happy to rebase or address any feedback if needed. Let me know if there's anything blocking review! |
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
StatusManager.get_task_statistics()always returned hard-coded zeroes forcompleted_tasks,success_rate, andaverage_execution_timewith a# TODO: Add completed task trackingcomment. This makes the statistics endpoint useless for monitoring constellation performance.Changes
galaxy/client/support/status_manager.py:_completed_tasksand_failed_tasksdicts (keyed bytask_id) toStatusManager.__init__record_task_completion(task_id, success, execution_time)method — callers invoke this after each task finishes to register the outcomeget_task_statistics()to compute real values from the recorded data:completed_tasks— count of successful tasksfailed_tasks— count of failed tasks (new field)success_rate—completed / (completed + failed), rounded to 3 dpaverage_execution_time— mean of recorded wall-clock times, rounded to 3 dpTesting
record_task_completionis calledsuccess_rateandaverage_execution_timehandle the empty-state (no tasks yet) without division-by-zero