Aller au contenu

Vue d'ensemble

Architecture globale

PerfShop est composé de 6 services Docker qui communiquent sur un réseau bridge dédié.

┌─────────────────────────────────────────────────────────────┐
│                    perfshop-network (bridge)                  │
│                                                               │
│  ┌──────────────┐    ┌──────────────┐    ┌────────────────┐  │
│  │   Frontend   │───▶│   Backend    │───▶│   PostgreSQL   │  │
│  │ React/Nginx  │    │ Spring Boot  │    │      BDD       │  │
│  │   :8090      │    │    :8080     │    │    :5432       │  │
│  └──────────────┘    └──────────────┘    └────────────────┘  │
│                             │                                  │
│  ┌──────────────┐    ┌──────────────┐    ┌────────────────┐  │
│  │  Monitoring  │◀───│  Prometheus  │◀───│    Grafana     │  │
│  │  Node.js     │    │    :9091     │    │    :3002       │  │
│  │   :3001      │    └──────────────┘    └────────────────┘  │
│  └──────────────┘                                             │
└─────────────────────────────────────────────────────────────┘

Flux de données

Métriques système

Docker socket ──▶ Monitoring Node.js (/metrics) ──▶ Prometheus ──▶ Grafana

Métriques navigateur

chaos-agent.js (navigateur) ──▶ POST /api/chaos/client-metrics ──▶ Monitoring Node.js
                                                               Prometheus (/metrics)
                                                                      Grafana

Chaos Backend

Panneau de contrôle ──▶ POST /api/chaos/backend/state ──▶ ChaosService.java
                                              ┌───────────────────┼───────────────────┐
                                              ▼                   ▼                   ▼
                                       CpuChaosScheduler   MemoryLeakService   ThreadPoolChaos

Chaos Frontend

Panneau de contrôle ──▶ GET /api/chaos/frontend/state ──▶ chaos-agent.js (polling 5s)
                                          ┌───────────────────────┼────────────────────┐
                                          ▼                       ▼                    ▼
                                    startCpuBurn()        startMemoryLeak()    startFetchFlood()