Skip to content

fix(monitoring): report actual process thread_count in system metrics#1530

Open
SH20RAJ wants to merge 1 commit intomofa-org:mainfrom
SH20RAJ:fix/1201-thread-count-metric
Open

fix(monitoring): report actual process thread_count in system metrics#1530
SH20RAJ wants to merge 1 commit intomofa-org:mainfrom
SH20RAJ:fix/1201-thread-count-metric

Conversation

@SH20RAJ
Copy link
Copy Markdown

@SH20RAJ SH20RAJ commented Mar 28, 2026

Fixes incorrect thread_count calculation in mofa-monitoring system metrics collection.

What changed:

  • replaced Option::iter().count() misuse with correct inner task-set length handling
  • added helper function for explicit and safe conversion to u32
  • added regression tests for None and populated task-set cases

Why this aligns with GSoC idea:

  • directly improves observability correctness under the Cognitive Observatory direction (ideas-list Idea 2 / mofa-monitoring development)

Closes #1201

@SH20RAJ
Copy link
Copy Markdown
Author

SH20RAJ commented Mar 28, 2026

Hi! Fixed the thread count calculation in mofa-monitoring. This ensures that system metrics accurately reflect the number of active threads in the process, which is essential for the 'Cognitive Observatory' monitoring goals (Idea 2). (Fixes #1201)

@SH20RAJ
Copy link
Copy Markdown
Author

SH20RAJ commented Mar 29, 2026

Addressing Issue #1201. This PR fixes an incorrect thread_count calculation in mofa-monitoring by correctly handling the task-set length instead of misusing Option::iter().count(). This ensures accurate system metrics in the 'Cognitive Observatory' (GSoC Idea #2), which is vital for production monitoring and performance tuning. 📊

@SH20RAJ
Copy link
Copy Markdown
Author

SH20RAJ commented Mar 30, 2026

Checks are green on this PR now. It is a small mofa-monitoring correctness fix for thread_count, which felt like a practical fit for the Cognitive Observatory / monitoring track in the GSoC 2026 ideas list. Happy to adjust naming or metric-contract details if maintainers would prefer a different shape here.

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.

[Bug]: thread_count in system metrics is always 0 or 1 due to Option::iter().count() misuse

1 participant