# aditya-1406/ai-load-testing architecture

> Architecture diagram of the GitHub repository aditya-1406/ai-load-testing, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aditya-1406/ai-load-testing
- Repository: https://github.com/aditya-1406/ai-load-testing

## Overview

The repository is an AI-assisted load-testing framework, with a separate Flask notes API that can serve as a test target. The main workflow runs concurrent trials against a configured API, analyzes results with feature engineering and ML, then presents metrics, predictions, anomalies, and a digital-twin simulation in Streamlit. The README also documents a standalone baseline tester and notes CRUD capability. The core load-test implementation was not excerpted, so its internal call relationships are shown only where documented; the graph does not assume its internal function structure.

Main entry points: [`AI_Load_Test/ui.py`](https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/ui.py) (Streamlit dashboard), [`AI_Load_Test/concurrency_test.py`](https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/concurrency_test.py) (Concurrent test runner), [`AI_Load_Test/ai_load_testing_results.csv`](https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/ai_load_testing_results.csv) (Test results CSV), [`AI_Load_Test/api.py`](https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/api.py) (Notes REST API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_load["Load testing"]
  node_load_runner["Concurrent test runner"]
  node_baseline["Baseline tester<br/>[baselin.py]"]
  node_results_csv["Test results CSV"]
end

subgraph group_analysis["Analysis and simulation"]
  node_feature_engineering["Feature engineering"]
  node_performance_models["Performance models"]
  node_failure_classifier["Failure classifier"]
  node_anomaly_detection["Anomaly detection"]
  node_threshold["Failure threshold"]
  node_digital_twin["Digital twin"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard["Streamlit dashboard<br/>[ui.py]"]
end

subgraph group_notes["Notes API"]
  node_notes_api["Notes REST API<br/>[api.py]"]
  node_notes_helper["Notes database helper<br/>[helper.py]"]
  node_notes_db[("Notes SQLite database<br/>[notes.db]")]
end

node_operator(("Test operator"))
node_target["Target API"]
node_notes_client(("API consumer"))

node_operator -->|"controls tests"| node_dashboard
node_dashboard -->|"runs trials"| node_load_runner
node_load_runner -->|"sends requests"| node_target
node_operator -->|"runs directly"| node_load_runner
node_baseline -->|"measures latency"| node_target
node_dashboard -->|"engineers features"| node_feature_engineering
node_dashboard -->|"trains regressor"| node_performance_models
node_dashboard -->|"classifies failures"| node_failure_classifier
node_dashboard -->|"detects anomalies"| node_anomaly_detection
node_dashboard -->|"estimates threshold"| node_threshold
node_dashboard -->|"simulates behavior"| node_digital_twin
node_dashboard -->|"writes results"| node_results_csv
node_results_csv -->|"loads uploaded data"| node_dashboard
node_notes_client -->|"uses CRUD API"| node_notes_api
node_notes_api -->|"delegates storage"| node_notes_helper
node_notes_helper -->|"reads and writes"| node_notes_db

click node_dashboard "https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/ui.py"
click node_load_runner "https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/concurrency_test.py"
click node_baseline "https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/baselin.py"
click node_feature_engineering "https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/concurrency_test.py"
click node_performance_models "https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/concurrency_test.py"
click node_failure_classifier "https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/concurrency_test.py"
click node_anomaly_detection "https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/concurrency_test.py"
click node_threshold "https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/concurrency_test.py"
click node_digital_twin "https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/concurrency_test.py"
click node_results_csv "https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/ai_load_testing_results.csv"
click node_notes_api "https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/api.py"
click node_notes_helper "https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/helper.py"
click node_notes_db "https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/notes.db"

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_load_runner,node_baseline,node_results_csv toneBlue
class node_feature_engineering,node_performance_models,node_failure_classifier,node_anomaly_detection,node_threshold,node_digital_twin toneAmber
class node_dashboard,node_target,node_notes_client toneMint
class node_notes_api,node_notes_helper,node_notes_db toneRose
class node_operator toneIndigo
```

## Components

### Load testing

- [Concurrent test runner](https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/concurrency_test.py): `AI_Load_Test/concurrency_test.py`
- [Baseline tester](https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/baselin.py): `AI_Load_Test/baselin.py`
- [Test results CSV](https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/ai_load_testing_results.csv): `AI_Load_Test/ai_load_testing_results.csv`

### Analysis and simulation

- [Feature engineering](https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/concurrency_test.py): `AI_Load_Test/concurrency_test.py`
- [Performance models](https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/concurrency_test.py): `AI_Load_Test/concurrency_test.py`
- [Failure classifier](https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/concurrency_test.py): `AI_Load_Test/concurrency_test.py`
- [Anomaly detection](https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/concurrency_test.py): `AI_Load_Test/concurrency_test.py`
- [Failure threshold](https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/concurrency_test.py): `AI_Load_Test/concurrency_test.py`
- [Digital twin](https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/concurrency_test.py): `AI_Load_Test/concurrency_test.py`

### Dashboard

- [Streamlit dashboard](https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/ui.py): `AI_Load_Test/ui.py`

### Notes API

- [Notes REST API](https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/api.py): `AI_Load_Test/api.py`
- [Notes database helper](https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/helper.py): `AI_Load_Test/helper.py`
- [Notes SQLite database](https://github.com/aditya-1406/ai-load-testing/blob/main/AI_Load_Test/notes.db): `AI_Load_Test/notes.db`

### Other components

- **Test operator**
- **Target API**
- **API consumer**

## Connections

- Test operator → Streamlit dashboard: controls tests (evidence: `README.md`)
- Streamlit dashboard → Concurrent test runner: runs trials (evidence: `AI_Load_Test/ui.py`)
- Concurrent test runner → Target API: sends requests (evidence: `README.md`)
- Test operator → Concurrent test runner: runs directly (evidence: `README.md`)
- Baseline tester → Target API: measures latency (evidence: `AI_Load_Test/baselin.py`)
- Streamlit dashboard → Feature engineering: engineers features (evidence: `AI_Load_Test/ui.py`)
- Streamlit dashboard → Performance models: trains regressor (evidence: `AI_Load_Test/ui.py`)
- Streamlit dashboard → Failure classifier: classifies failures (evidence: `AI_Load_Test/ui.py`)
- Streamlit dashboard → Anomaly detection: detects anomalies (evidence: `AI_Load_Test/ui.py`)
- Streamlit dashboard → Failure threshold: estimates threshold (evidence: `AI_Load_Test/ui.py`)
- Streamlit dashboard → Digital twin: simulates behavior (evidence: `AI_Load_Test/ui.py`)
- Streamlit dashboard → Test results CSV: writes results (evidence: `AI_Load_Test/ui.py`)
- Test results CSV → Streamlit dashboard: loads uploaded data (evidence: `AI_Load_Test/ui.py`)
- API consumer → Notes REST API: uses CRUD API (evidence: `README.md`)
- Notes REST API → Notes database helper: delegates storage (evidence: `AI_Load_Test/api.py`)
- Notes database helper → Notes SQLite database: reads and writes (evidence: `AI_Load_Test/helper.py`)
