# six-ddc/plow architecture

> Architecture diagram of the GitHub repository six-ddc/plow, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/six-ddc/plow
- Repository: https://github.com/six-ddc/plow

## Overview

##### Main Components Identification

a) Core Components:
- HTTP Benchmarking Engine (requester.go)
- Results Processing System (report.go)
- Real-time Visualization
- Terminal Output (print.go)
- Web UI Server (charts.go)
- Benchmark Server (bench_server/main.go)

**┌─────────────────────────────────────────────────────────────┐**
- Plow System                         │

- ┌──────────────┐         ┌───────────────────────┐        │
- CLI Interface│─────────▶│ Request Orchestrator  │        │
- ┘         │     (requester.go)    │        │
- ┬───────────┘        │

- ▼                     │
- ┌──────────────┐         ┌───────────────────────┐        │
- Target HTTP  │◀────────│   FastHTTP Client     │        │
- Server     │─────────▶│                      │        │
- ┘         └───────────┬───────────┘        │

- ▼                     │
- ┌──────────────┐         ┌───────────────────────┐        │
- Real-time   │◀────────│   Metrics Collector   │        │
- Web UI     │         │     (report.go)       │        │
- (charts.go)  │         └───────────┬───────────┘        │
- ┘                     │                     │

- ┌──────────────┐                    ▼                     │
- Terminal    │◀─────────┐ ┌───────────────────────┐     │
- Output     │         │ │    Statistics Engine   │     │
- (print.go)   │◀────────┴─│                       │     │
- ┘           └───────────────────────┘     │
- ┘

##### Key Relationships to Highlight

a) Data Flow:
- CLI input → Request Orchestrator
- Request Orchestrator → FastHTTP Client
- FastHTTP Client ↔ Target HTTP Server
- Metrics Collector → Statistics Engine
- Statistics Engine → Output Systems (Web UI and Terminal)

b) Component Interactions:
- How the FastHTTP client handles concurrent connections
- Real-time metrics collection flow
- Demonstrate how the statistics engine feeds both the web UI and terminal output

##### Technical Details

- Use of FastHTTP instead of net/http
- Concurrent connection handling (option -c)
- Real-time statistics processing pipeline
- Web UI server port (default :18888)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph System["Plow HTTP(S) Benchmarking System"]
        CLI["CLI Interface"]:::input
        click CLI "https://github.com/six-ddc/plow/blob/main/main.go"
        
        ReqOrch["Request Orchestrator"]:::core
        click ReqOrch "https://github.com/six-ddc/plow/blob/main/requester.go"
        
        FastHTTP["FastHTTP Client"]:::core
        
        MetricsCol["Metrics Collector"]:::core
        click MetricsCol "https://github.com/six-ddc/plow/blob/main/report.go"
        
        StatsEngine["Statistics Engine"]:::core
        
        WebUI["Real-time Web UI\n(Port :18888)"]:::output
        click WebUI "https://github.com/six-ddc/plow/blob/main/charts.go"
        
        Terminal["Terminal Output"]:::output
        click Terminal "https://github.com/six-ddc/plow/blob/main/print.go"
        
        Target["Target HTTP(S)\nServer"]:::external
        click Target "https://github.com/six-ddc/plow/blob/main/bench_server/main.go"
        
        Docker["Container Runtime"]:::infra
        click Docker "https://github.com/six-ddc/plow/tree/main/Dockerfile"
        
        CI["CI/CD Pipeline"]:::infra
        click CI "https://github.com/six-ddc/plow/blob/main/.github/workflows/release.yml"
        
        Deps["Dependencies"]:::infra
        click Deps "https://github.com/six-ddc/plow/blob/main/go.mod"
    end
    
    %% Relationships
    CLI --> ReqOrch
    ReqOrch --> FastHTTP
    FastHTTP <--> |"HTTP(S) Requests"| Target
    FastHTTP --> MetricsCol
    MetricsCol --> StatsEngine
    StatsEngine --> |"Real-time Stats"| WebUI
    StatsEngine --> |"Live Updates"| Terminal
    
    %% Infrastructure Connections
    Docker -.-> CLI
    CI -.-> Docker
    Deps -.-> CLI
    
    %% Styling
    classDef core fill:#2374ab,stroke:#2374ab,color:#fff
    classDef input fill:#57a773,stroke:#57a773,color:#fff
    classDef output fill:#57a773,stroke:#57a773,color:#fff
    classDef external fill:#ff8c42,stroke:#ff8c42,color:#fff
    classDef infra fill:#6c757d,stroke:#6c757d,color:#fff
    
    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Input/Output Interfaces"]:::input
        L3["External Systems"]:::external
        L4["Infrastructure"]:::infra
    end
```
