# k-k-j123/incident-tester architecture

> Architecture diagram of the GitHub repository k-k-j123/incident-tester, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/k-k-j123/incident-tester
- Repository: https://github.com/k-k-j123/incident-tester

## Overview

Cloud Incident Tester is a Flask service that exposes health and information endpoints alongside configurable incident simulations. A client requests an endpoint; its handler returns a JSON response and, for incident scenarios, emits logs or creates CPU load. The application loads configuration from environment variables (and an optional .env file). All runtime behavior is implemented in one source file, so the graph groups related handlers rather than implying separate modules. The repository shows no external incident-management integrations.

Main entry points: [`cloud_incident_tester.py`](https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py) (Application logging)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP endpoints"]
  node_health["Health check"]
  node_home["Home response"]
  node_data["Data response"]
  node_info["Application info"]
end

subgraph group_incidents["Incident simulation"]
  node_error_log["Exception event"]
  node_resource["Resource spike"]
  node_worker["CPU worker"]
  node_security["Security event"]
end

subgraph group_runtime["Runtime support"]
  node_config["Environment config"]
  node_logging["Application logging"]
end

node_client(("HTTP client"))

node_client -->|"requests"| node_health
node_client -->|"requests"| node_home
node_client -->|"requests"| node_data
node_client -->|"requests"| node_info
node_client -->|"requests"| node_error_log
node_client -->|"requests"| node_resource
node_client -->|"requests"| node_security
node_resource -->|"spawns"| node_worker
node_config -->|"sets error rate"| node_home
node_config -->|"sets error rate"| node_data
node_config -->|"controls spikes"| node_resource
node_health -->|"logs request"| node_logging
node_home -->|"logs outcome"| node_logging
node_data -->|"logs outcome"| node_logging
node_error_log -->|"logs exception"| node_logging
node_resource -->|"logs activity"| node_logging
node_security -->|"logs event"| node_logging

click node_health "https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py"
click node_home "https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py"
click node_data "https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py"
click node_info "https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py"
click node_error_log "https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py"
click node_resource "https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py"
click node_worker "https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py"
click node_security "https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py"
click node_config "https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py"
click node_logging "https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.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_health,node_home,node_data,node_info,node_client toneBlue
class node_error_log,node_resource,node_worker,node_security toneAmber
class node_config,node_logging toneMint
```

## Components

### HTTP endpoints

- [Health check](https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py): `cloud_incident_tester.py`
- [Home response](https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py): `cloud_incident_tester.py`
- [Data response](https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py): `cloud_incident_tester.py`
- [Application info](https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py): `cloud_incident_tester.py`

### Incident simulation

- [Exception event](https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py): `cloud_incident_tester.py`
- [Resource spike](https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py): `cloud_incident_tester.py`
- [CPU worker](https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py): `cloud_incident_tester.py`
- [Security event](https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py): `cloud_incident_tester.py`

### Runtime support

- [Environment config](https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py): `cloud_incident_tester.py`
- [Application logging](https://github.com/k-k-j123/incident-tester/blob/main/cloud_incident_tester.py): `cloud_incident_tester.py`

### Other components

- **HTTP client**

## Connections

- HTTP client → Health check: requests (evidence: `cloud_incident_tester.py`)
- HTTP client → Home response: requests (evidence: `cloud_incident_tester.py`)
- HTTP client → Data response: requests (evidence: `cloud_incident_tester.py`)
- HTTP client → Application info: requests (evidence: `cloud_incident_tester.py`)
- HTTP client → Exception event: requests (evidence: `cloud_incident_tester.py`)
- HTTP client → Resource spike: requests (evidence: `cloud_incident_tester.py`)
- HTTP client → Security event: requests (evidence: `cloud_incident_tester.py`)
- Resource spike → CPU worker: spawns (evidence: `cloud_incident_tester.py`)
- Environment config → Home response: sets error rate (evidence: `cloud_incident_tester.py`)
- Environment config → Data response: sets error rate (evidence: `cloud_incident_tester.py`)
- Environment config → Resource spike: controls spikes (evidence: `cloud_incident_tester.py`)
- Health check → Application logging: logs request (evidence: `cloud_incident_tester.py`)
- Home response → Application logging: logs outcome (evidence: `cloud_incident_tester.py`)
- Data response → Application logging: logs outcome (evidence: `cloud_incident_tester.py`)
- Exception event → Application logging: logs exception (evidence: `cloud_incident_tester.py`)
- Resource spike → Application logging: logs activity (evidence: `cloud_incident_tester.py`)
- Security event → Application logging: logs event (evidence: `cloud_incident_tester.py`)
