Skip to content

feat: implement completed task tracking in StatusManager#326

Open
nuthalapativarun wants to merge 1 commit intomicrosoft:pre-releasefrom
nuthalapativarun:feat/status-manager-task-tracking
Open

feat: implement completed task tracking in StatusManager#326
nuthalapativarun wants to merge 1 commit intomicrosoft:pre-releasefrom
nuthalapativarun:feat/status-manager-task-tracking

Conversation

@nuthalapativarun
Copy link
Copy Markdown

Summary

StatusManager.get_task_statistics() always returned hard-coded zeroes for completed_tasks, success_rate, and average_execution_time with a # TODO: Add completed task tracking comment. This makes the statistics endpoint useless for monitoring constellation performance.

Changes

galaxy/client/support/status_manager.py:

  • Added _completed_tasks and _failed_tasks dicts (keyed by task_id) to StatusManager.__init__
  • Added record_task_completion(task_id, success, execution_time) method — callers invoke this after each task finishes to register the outcome
  • Updated get_task_statistics() to compute real values from the recorded data:
    • completed_tasks — count of successful tasks
    • failed_tasks — count of failed tasks (new field)
    • success_ratecompleted / (completed + failed), rounded to 3 dp
    • average_execution_time — mean of recorded wall-clock times, rounded to 3 dp

Testing

  • Statistics start at zero and update correctly as record_task_completion is called
  • success_rate and average_execution_time handle the empty-state (no tasks yet) without division-by-zero

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
@nuthalapativarun
Copy link
Copy Markdown
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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant