Skip to content

[Task] docs: Document DI container and C++20 concepts usage #463

Description

@kcenon

Summary

Document the dependency injection container, metric factory, and C++20 concepts used throughout monitoring_system for compile-time type safety and service resolution.

Parent Issue

Part of: [EPIC] docs: Address documentation gaps across all ecosystem systems (kcenon/common_system#325)

Background (Why)

monitoring_system uses advanced C++ patterns that need documentation:

  1. DI Container (di/service_registration.h) for service lifecycle management
  2. Metric Factory (factory/metric_factory.h) for collector creation and configuration
  3. C++20 Concepts (concepts/monitoring_concepts.h) for compile-time validation
  4. Adaptive Monitor (adaptive/adaptive_monitor.h) for self-tuning behavior

Source files:

  • include/kcenon/monitoring/di/service_registration.h — DI container
  • include/kcenon/monitoring/factory/metric_factory.h — Collector factory
  • include/kcenon/monitoring/factory/collector_adapters.h — Collector adapters
  • include/kcenon/monitoring/concepts/monitoring_concepts.h — C++20 concepts
  • include/kcenon/monitoring/adaptive/adaptive_monitor.h — Self-tuning monitor

Scope (What)

1. DI Container

  • Service registration and resolution
  • Lifecycle management (singleton, transient, scoped)
  • Named services and multi-implementation
  • Testing with DI (mock injection)

2. Metric Factory

  • Collector registration and creation
  • Configuration-driven collector selection
  • Dynamic loading and unloading
  • Factory customization

3. C++20 Concepts

  • Available concepts (EventType, EventHandler, CollectorType, etc.)
  • Compile-time validation examples
  • Custom concept implementation
  • Error messages when concepts are not satisfied

4. Adaptive Monitor

  • Self-tuning collection intervals
  • Load-based adjustment
  • Adaptive sampling

5. Usage Examples

  • Complete DI setup with all services
  • Factory-based collector configuration
  • Concept-constrained custom types

Acceptance Criteria

  • DI container API documented with lifecycle patterns
  • Metric factory configuration documented
  • C++20 concepts listed with usage examples
  • Adaptive monitor behavior documented
  • Complete DI + factory setup example

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coreCore architecture and infrastructuredocumentationImprovements or additions to documentationpriority/lowLow priority - Nice to have

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions