feat: Phase 5 - Metrics and dashboard API (T-020)
- Add GET /metrics/summary endpoint with global coverage counts and percentage - Add GET /metrics/by-tactic endpoint with per-tactic coverage breakdown - Handle multi-tactic techniques (comma-separated) counting in each tactic - Add CoverageSummary and TacticCoverage Pydantic schemas - Update README with metrics endpoints and project structure
This commit is contained in:
27
backend/app/schemas/metrics.py
Normal file
27
backend/app/schemas/metrics.py
Normal file
@@ -0,0 +1,27 @@
|
||||
"""Pydantic schemas for coverage-metrics endpoints."""
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class CoverageSummary(BaseModel):
|
||||
"""Global coverage summary across all MITRE ATT&CK techniques."""
|
||||
|
||||
total_techniques: int
|
||||
validated: int
|
||||
partial: int
|
||||
not_covered: int
|
||||
in_progress: int
|
||||
not_evaluated: int
|
||||
coverage_percentage: float # (validated + partial) / total * 100
|
||||
|
||||
|
||||
class TacticCoverage(BaseModel):
|
||||
"""Coverage breakdown for a single tactic."""
|
||||
|
||||
tactic: str
|
||||
total: int
|
||||
validated: int
|
||||
partial: int
|
||||
not_covered: int
|
||||
not_evaluated: int
|
||||
in_progress: int
|
||||
Reference in New Issue
Block a user