Skip to content

Enforce common_system dependency and add runtime metrics#92

Merged
kcenon merged 5 commits into
mainfrom
feat/common-system-required
Nov 20, 2025
Merged

Enforce common_system dependency and add runtime metrics#92
kcenon merged 5 commits into
mainfrom
feat/common-system-required

Conversation

@kcenon

@kcenon kcenon commented Nov 20, 2025

Copy link
Copy Markdown
Owner

Summary

This PR strengthens thread_system's foundation by enforcing common_system dependency and adding comprehensive runtime metrics:

  1. Required Dependency on common_system

    • Enforce common_system availability at CMake configuration time
    • Ensure IExecutor interface compatibility
    • Align with unified build system architecture
  2. Runtime Performance Metrics

    • Thread pool metrics collection and tracking
    • Job lifecycle monitoring (submission, completion, rejection)
    • Queue depth and worker utilization metrics

Changes

Build System

  • Add fatal error when common_system is not available
  • Update ThreadSystemDependencies.cmake for proper detection
  • Ensure unified build integration

Metrics Infrastructure

  • New ThreadPoolMetrics class with atomic counters
  • Track job counts, queue depth, worker activity
  • Provide read-only access and reset functionality

Thread Pool Integration

  • Add metrics() accessor to ThreadPool
  • Integrate metrics collection in job submission path
  • Update workers to record completion events
  • Maintain zero-overhead when metrics not accessed

API Changes

New Public Methods

const metrics::ThreadPoolMetrics& thread_pool::metrics() const noexcept;
void thread_pool::reset_metrics();

Breaking Changes

  • thread_system now REQUIRES common_system
  • Projects must link against common_system

Testing

  • Builds with common_system dependency
  • Metrics accumulate correctly
  • Reset functionality works
  • No performance regression

Migration Guide

For standalone builds:

set(BUILD_WITH_COMMON_SYSTEM ON)
find_package(common_system REQUIRED)
target_link_libraries(your_target PRIVATE thread_system)

Performance Impact

  • Metrics use atomic operations (minimal overhead)
  • No impact when metrics not accessed
  • Reset operation is O(1)

- Add fatal error when common_system is not available
- Ensure IExecutor interface compatibility
- Update dependency detection logic
- Align with unified build system requirements
- Add ThreadPoolMetrics class for performance tracking
- Track job submission, completion, and rejection rates
- Measure queue depth and worker utilization
- Provide reset functionality for metrics
- Enable monitoring system integration
- Add metrics() accessor and reset_metrics() to ThreadPool
- Track job execution in workers
- Update queue depth on job submission
- Record completion and rejection events
- Maintain backward compatibility
@github-actions

Copy link
Copy Markdown
Contributor

📊 Performance Benchmark Results

Performance Benchmark Report

No benchmark data available.

ℹ️ No baseline reference available

This is the first benchmark run or baseline file is missing.

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

📊 Performance Benchmark Results

Performance Benchmark Report

No benchmark data available.

ℹ️ No baseline reference available

This is the first benchmark run or baseline file is missing.

kcenon added a commit that referenced this pull request Nov 20, 2025
Add step to clone common_system repository before CMake configuration.
This is required because PR #92 enforces common_system as a mandatory
dependency for ThreadSystem.

Without this step, the CMake configuration fails with:
"common_system not found - set COMMON_SYSTEM_DIR or add as dependency."

Follows the same pattern used in ci.yml workflow.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

📊 Performance Benchmark Results

Performance Benchmark Report

No benchmark data available.

ℹ️ No baseline reference available

This is the first benchmark run or baseline file is missing.

ThreadSystem now requires common_system as a mandatory dependency
(as enforced in CMakeLists.txt:41-43). Update static-analysis.yml
to set BUILD_WITH_COMMON_SYSTEM=ON instead of OFF to align with
this requirement and fix the Clang-Tidy Analysis workflow failure.

Resolves the CMake configuration error:
"ThreadSystem now requires common_system. Set BUILD_WITH_COMMON_SYSTEM=ON."
Add step to clone common_system repository before CMake configuration.
This is required because PR #92 enforces common_system as a mandatory
dependency for ThreadSystem.

Without this step, the CMake configuration fails with:
"common_system not found - set COMMON_SYSTEM_DIR or add as dependency."

Follows the same pattern used in ci.yml workflow.
@kcenon kcenon force-pushed the feat/common-system-required branch from 1be6401 to 6fd0007 Compare November 20, 2025 11:52
@github-actions

Copy link
Copy Markdown
Contributor

📊 Performance Benchmark Results

Performance Benchmark Report

No benchmark data available.

ℹ️ No baseline reference available

This is the first benchmark run or baseline file is missing.

@kcenon kcenon merged commit 50657e5 into main Nov 20, 2025
24 checks passed
@kcenon kcenon deleted the feat/common-system-required branch November 20, 2025 12:03
kcenon added a commit that referenced this pull request Nov 21, 2025
* feat: enforce common_system as required dependency

- Add fatal error when common_system is not available
- Ensure IExecutor interface compatibility
- Update dependency detection logic
- Align with unified build system requirements

* feat: add thread pool runtime metrics

- Add ThreadPoolMetrics class for performance tracking
- Track job submission, completion, and rejection rates
- Measure queue depth and worker utilization
- Provide reset functionality for metrics
- Enable monitoring system integration

* feat: integrate metrics into thread pool and workers

- Add metrics() accessor and reset_metrics() to ThreadPool
- Track job execution in workers
- Update queue depth on job submission
- Record completion and rejection events
- Maintain backward compatibility

* fix: enable common_system in static-analysis workflow

ThreadSystem now requires common_system as a mandatory dependency
(as enforced in CMakeLists.txt:41-43). Update static-analysis.yml
to set BUILD_WITH_COMMON_SYSTEM=ON instead of OFF to align with
this requirement and fix the Clang-Tidy Analysis workflow failure.

Resolves the CMake configuration error:
"ThreadSystem now requires common_system. Set BUILD_WITH_COMMON_SYSTEM=ON."

* fix: add common_system checkout in static-analysis workflow

Add step to clone common_system repository before CMake configuration.
This is required because PR #92 enforces common_system as a mandatory
dependency for ThreadSystem.

Without this step, the CMake configuration fails with:
"common_system not found - set COMMON_SYSTEM_DIR or add as dependency."

Follows the same pattern used in ci.yml workflow.
kcenon added a commit that referenced this pull request Apr 13, 2026
* feat: enforce common_system as required dependency

- Add fatal error when common_system is not available
- Ensure IExecutor interface compatibility
- Update dependency detection logic
- Align with unified build system requirements

* feat: add thread pool runtime metrics

- Add ThreadPoolMetrics class for performance tracking
- Track job submission, completion, and rejection rates
- Measure queue depth and worker utilization
- Provide reset functionality for metrics
- Enable monitoring system integration

* feat: integrate metrics into thread pool and workers

- Add metrics() accessor and reset_metrics() to ThreadPool
- Track job execution in workers
- Update queue depth on job submission
- Record completion and rejection events
- Maintain backward compatibility

* fix: enable common_system in static-analysis workflow

ThreadSystem now requires common_system as a mandatory dependency
(as enforced in CMakeLists.txt:41-43). Update static-analysis.yml
to set BUILD_WITH_COMMON_SYSTEM=ON instead of OFF to align with
this requirement and fix the Clang-Tidy Analysis workflow failure.

Resolves the CMake configuration error:
"ThreadSystem now requires common_system. Set BUILD_WITH_COMMON_SYSTEM=ON."

* fix: add common_system checkout in static-analysis workflow

Add step to clone common_system repository before CMake configuration.
This is required because PR #92 enforces common_system as a mandatory
dependency for ThreadSystem.

Without this step, the CMake configuration fails with:
"common_system not found - set COMMON_SYSTEM_DIR or add as dependency."

Follows the same pattern used in ci.yml workflow.
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