# yash45615/continuous-performance-benchmarking-regression-detection-platform architecture

> Architecture diagram of the GitHub repository yash45615/continuous-performance-benchmarking-regression-detection-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yash45615/continuous-performance-benchmarking-regression-detection-platform
- Repository: https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform

## Overview

This repository is a continuous performance benchmarking and regression-analysis platform, with an instrumented product API as a workload target. The documented workflow runs repeatable workloads, compares measurements to baselines, investigates regressions, triages ownership, reports findings, and applies CI gates. API routing, benchmark persistence, regression analysis, profiling/database investigation, and reporting are represented; several workflow links remain undocumented in the sampled source, so they are omitted or shown as unverified. The README documents Locust and metrics capabilities, while the benchmark-runner implementation is not present in the supplied tree.

Main entry points: [`backend/app/database.py`](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/database.py) (Database Session), [`backend/app/main.py`](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/main.py) (FastAPI Service), [`regression/detector.py`](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/regression/detector.py) (Regression Detector), [`backend/app/routes/products.py`](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/routes/products.py) (Product Endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Product API"]
  node_api_app["FastAPI Service<br/>[main.py]"]
  node_product_routes["Product Endpoints<br/>[products.py]"]
  node_product_model["Product Model<br/>[product.py]"]
  node_metrics_endpoint["Prometheus Metrics<br/>[main.py]"]
end

subgraph group_benchmark["Benchmark Data"]
  node_benchmark_routes["Benchmark Endpoints<br/>[benchmarks.py]"]
  node_benchmark_service["Run Service"]
  node_benchmark_metric["Metric Model"]
  node_database["Database Session<br/>[database.py]"]
  node_settings["Runtime Settings<br/>[config.py]"]
end

subgraph group_analysis["Regression Analysis"]
  node_baseline["Baseline Management<br/>[baseline.py]"]
  node_variance["Variance &amp; Noise<br/>[variance.py]"]
  node_environment["Environment Comparison<br/>[environment.py]"]
  node_detector["Regression Detector<br/>[detector.py]"]
end

subgraph group_investigation["Profiling &amp; Triage"]
  node_profile_api["API Profiler<br/>[profile_api.py]"]
  node_profile_db["Database Profiler"]
  node_query_analyzer["Query Analyzer<br/>[query_analyzer.py]"]
  node_plan_diff["Plan Diff<br/>[plan_diff.py]"]
  node_triage_analyzer["Regression Analysis<br/>[analyzer.py]"]
  node_owner_router["Owner Routing<br/>[router.py]"]
end

subgraph group_outputs["Reports &amp; Gates"]
  node_report_generator["Report Generator<br/>[generator.py]"]
  node_ci_gate["CI Performance Gate"]
end

node_engineer(("Engineer"))
node_locust["Locust Workload<br/>[locustfile.py]"]
node_postgres[("PostgreSQL")]

node_engineer -->|"starts workload"| node_locust
node_locust -.->|"sends traffic"| node_api_app
node_api_app -->|"registers routes"| node_product_routes
node_api_app -->|"registers routes"| node_benchmark_routes
node_api_app -->|"creates tables"| node_database
node_api_app -->|"exposes metrics"| node_metrics_endpoint
node_product_routes -->|"queries via"| node_database
node_product_routes -->|"queries"| node_product_model
node_benchmark_routes -->|"delegates to"| node_benchmark_service
node_benchmark_routes -->|"injects session"| node_database
node_benchmark_service -->|"persists runs"| node_database
node_benchmark_metric -->|"uses base"| node_database
node_database -->|"reads URL"| node_settings
node_database -.->|"connects"| node_postgres
node_engineer -.->|"sets baseline"| node_baseline
node_baseline -.->|"compared by"| node_detector
node_variance -.->|"informs confidence"| node_detector
node_environment -.->|"checks comparability"| node_detector
node_engineer -.->|"investigates"| node_profile_api
node_engineer -.->|"investigates"| node_profile_db
node_profile_db -.->|"analyzes queries"| node_query_analyzer
node_query_analyzer -.->|"compares plans"| node_plan_diff
node_detector -.->|"triages regression"| node_triage_analyzer
node_triage_analyzer -.->|"routes owner"| node_owner_router
node_engineer -.->|"requests report"| node_report_generator
node_engineer -.->|"runs gate"| node_ci_gate

click node_locust "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/load_tests/locustfile.py"
click node_api_app "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/main.py"
click node_product_routes "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/routes/products.py"
click node_product_model "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/models/product.py"
click node_benchmark_routes "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/routes/benchmarks.py"
click node_benchmark_service "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/services/benchmark_service.py"
click node_benchmark_metric "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/models/benchmark_metric.py"
click node_database "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/database.py"
click node_settings "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/config.py"
click node_metrics_endpoint "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/main.py"
click node_baseline "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/regression/baseline.py"
click node_variance "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/regression/variance.py"
click node_environment "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/regression/environment.py"
click node_detector "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/regression/detector.py"
click node_profile_api "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/profiling/profile_api.py"
click node_profile_db "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/profiling/profile_database.py"
click node_query_analyzer "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/profiling/query_analyzer.py"
click node_plan_diff "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/profiling/plan_diff.py"
click node_triage_analyzer "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/triage/analyzer.py"
click node_owner_router "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/triage/router.py"
click node_report_generator "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/reports/generator.py"
click node_ci_gate "https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/scripts/performance_gate.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api_app,node_product_routes,node_product_model,node_metrics_endpoint toneBlue
class node_benchmark_routes,node_benchmark_service,node_benchmark_metric,node_database,node_settings,node_postgres toneAmber
class node_baseline,node_variance,node_environment,node_detector toneMint
class node_profile_api,node_profile_db,node_query_analyzer,node_plan_diff,node_triage_analyzer,node_owner_router toneRose
class node_report_generator,node_ci_gate,node_engineer toneIndigo
class node_locust toneTeal
```

## Components

### Product API

- [FastAPI Service](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/main.py): `backend/app/main.py`
- [Product Endpoints](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/routes/products.py): `backend/app/routes/products.py`
- [Product Model](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/models/product.py): `backend/app/models/product.py`
- [Prometheus Metrics](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/main.py): `backend/app/main.py`

### Benchmark Data

- [Benchmark Endpoints](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/routes/benchmarks.py): `backend/app/routes/benchmarks.py`
- [Run Service](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/services/benchmark_service.py): `backend/app/services/benchmark_service.py`
- [Metric Model](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/models/benchmark_metric.py): `backend/app/models/benchmark_metric.py`
- [Database Session](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/database.py): `backend/app/database.py`
- [Runtime Settings](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/backend/app/config.py): `backend/app/config.py`

### Regression Analysis

- [Baseline Management](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/regression/baseline.py): `regression/baseline.py`
- [Variance & Noise](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/regression/variance.py): `regression/variance.py`
- [Environment Comparison](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/regression/environment.py): `regression/environment.py`
- [Regression Detector](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/regression/detector.py): `regression/detector.py`

### Profiling & Triage

- [API Profiler](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/profiling/profile_api.py): `profiling/profile_api.py`
- [Database Profiler](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/profiling/profile_database.py): `profiling/profile_database.py`
- [Query Analyzer](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/profiling/query_analyzer.py): `profiling/query_analyzer.py`
- [Plan Diff](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/profiling/plan_diff.py): `profiling/plan_diff.py`
- [Regression Analysis](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/triage/analyzer.py): `triage/analyzer.py`
- [Owner Routing](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/triage/router.py): `triage/router.py`

### Reports & Gates

- [Report Generator](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/reports/generator.py): `reports/generator.py`
- [CI Performance Gate](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/scripts/performance_gate.py): `scripts/performance_gate.py`

### Other components

- **Engineer**
- [Locust Workload](https://github.com/yash45615/continuous-performance-benchmarking-regression-detection-platform/blob/main/load_tests/locustfile.py): `load_tests/locustfile.py`
- **PostgreSQL**

## Connections

- Engineer → Locust Workload: starts workload
- Locust Workload → FastAPI Service: sends traffic
- FastAPI Service → Product Endpoints: registers routes (evidence: `backend/app/main.py`)
- FastAPI Service → Benchmark Endpoints: registers routes (evidence: `backend/app/main.py`)
- FastAPI Service → Database Session: creates tables (evidence: `backend/app/main.py`)
- FastAPI Service → Prometheus Metrics: exposes metrics (evidence: `backend/app/main.py`)
- Product Endpoints → Database Session: queries via (evidence: `backend/app/routes/products.py`)
- Product Endpoints → Product Model: queries (evidence: `backend/app/routes/products.py`)
- Benchmark Endpoints → Run Service: delegates to (evidence: `backend/app/routes/benchmarks.py`)
- Benchmark Endpoints → Database Session: injects session (evidence: `backend/app/routes/benchmarks.py`)
- Run Service → Database Session: persists runs (evidence: `backend/app/services/benchmark_service.py`)
- Metric Model → Database Session: uses base (evidence: `backend/app/models/benchmark_metric.py`)
- Database Session → Runtime Settings: reads URL (evidence: `backend/app/database.py`)
- Database Session → PostgreSQL: connects
- Engineer → Baseline Management: sets baseline
- Baseline Management → Regression Detector: compared by
- Variance & Noise → Regression Detector: informs confidence
- Environment Comparison → Regression Detector: checks comparability
- Engineer → API Profiler: investigates
- Engineer → Database Profiler: investigates
- Database Profiler → Query Analyzer: analyzes queries
- Query Analyzer → Plan Diff: compares plans
- Regression Detector → Regression Analysis: triages regression
- Regression Analysis → Owner Routing: routes owner (evidence: `triage/full_triage.py`)
- Engineer → Report Generator: requests report
- Engineer → CI Performance Gate: runs gate
