# rakyll/hey architecture

> Architecture diagram of the GitHub repository rakyll/hey, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rakyll/hey
- Repository: https://github.com/rakyll/hey

## Overview

hey is a command-line HTTP load generator. A user supplies a URL and load/request options; the command builds a configured request and Work, which runs concurrent workers against the target, records per-request timing and status results, and reports summary or CSV metrics. The documented feature branches include HTTP/2, proxying, request customization and rate/duration limits. Edges reflect the shown call sites; platform-specific clock implementations are represented together, and external target traffic is documented by the README.

Main entry points: [`requester/requester.go`](https://github.com/rakyll/hey/blob/master/requester/requester.go) (Concurrent HTTP workers), [`requester/report.go`](https://github.com/rakyll/hey/blob/master/requester/report.go) (Metrics aggregation), [`hey.go`](https://github.com/rakyll/hey/blob/master/hey.go) (Options and request setup), [`requester/print.go`](https://github.com/rakyll/hey/blob/master/requester/print.go) (Summary and CSV formatting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_command["Command setup"]
  node_command["Options and request setup<br/>[hey.go]"]
end

subgraph group_execution["Load execution"]
  node_work["Load coordinator<br/>[requester.go]"]
  node_workers["Concurrent HTTP workers<br/>[requester.go]"]
  node_results["Request results<br/>[requester.go]"]
  node_clock["Timing clock<br/>[now_other.go]"]
end

subgraph group_reporting["Metrics and output"]
  node_reporter["Metrics aggregation<br/>[report.go]"]
  node_format["Summary and CSV formatting<br/>[print.go]"]
end

node_user(("CLI user"))
node_target(("HTTP target"))
node_output(("Report destination"))

node_user -->|"supplies options"| node_command
node_command -->|"configures and runs"| node_work
node_work -->|"starts workers"| node_workers
node_workers -->|"sends HTTP requests"| node_target
node_workers -->|"publishes measurements"| node_results
node_work -->|"starts reporter"| node_reporter
node_reporter -->|"consumes results"| node_results
node_reporter -->|"renders report"| node_format
node_format -->|"writes formatted output"| node_output
node_workers -->|"measures timings"| node_clock

click node_command "https://github.com/rakyll/hey/blob/master/hey.go"
click node_work "https://github.com/rakyll/hey/blob/master/requester/requester.go"
click node_workers "https://github.com/rakyll/hey/blob/master/requester/requester.go"
click node_results "https://github.com/rakyll/hey/blob/master/requester/requester.go"
click node_clock "https://github.com/rakyll/hey/blob/master/requester/now_other.go"
click node_reporter "https://github.com/rakyll/hey/blob/master/requester/report.go"
click node_format "https://github.com/rakyll/hey/blob/master/requester/print.go"

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_command,node_user toneBlue
class node_work,node_workers,node_results,node_clock toneAmber
class node_reporter,node_format toneMint
class node_target,node_output toneIndigo
```

## Components

### Command setup

- [Options and request setup](https://github.com/rakyll/hey/blob/master/hey.go): `hey.go`

### Load execution

- [Load coordinator](https://github.com/rakyll/hey/blob/master/requester/requester.go): `requester/requester.go`
- [Concurrent HTTP workers](https://github.com/rakyll/hey/blob/master/requester/requester.go): `requester/requester.go`
- [Request results](https://github.com/rakyll/hey/blob/master/requester/requester.go): `requester/requester.go`
- [Timing clock](https://github.com/rakyll/hey/blob/master/requester/now_other.go): `requester/now_other.go`

### Metrics and output

- [Metrics aggregation](https://github.com/rakyll/hey/blob/master/requester/report.go): `requester/report.go`
- [Summary and CSV formatting](https://github.com/rakyll/hey/blob/master/requester/print.go): `requester/print.go`

### Other components

- **CLI user**
- **HTTP target**
- **Report destination**

## Connections

- CLI user → Options and request setup: supplies options (evidence: `README.md`)
- Options and request setup → Load coordinator: configures and runs (evidence: `hey.go`)
- Load coordinator → Concurrent HTTP workers: starts workers (evidence: `requester/requester.go`)
- Concurrent HTTP workers → HTTP target: sends HTTP requests (evidence: `README.md`)
- Concurrent HTTP workers → Request results: publishes measurements (evidence: `requester/requester.go`)
- Load coordinator → Metrics aggregation: starts reporter (evidence: `requester/requester.go`)
- Metrics aggregation → Request results: consumes results (evidence: `requester/report.go`)
- Metrics aggregation → Summary and CSV formatting: renders report (evidence: `requester/report.go`)
- Summary and CSV formatting → Report destination: writes formatted output (evidence: `requester/print.go`)
- Concurrent HTTP workers → Timing clock: measures timings (evidence: `requester/requester.go`)
