# saikiransangam/shakedown architecture

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

- Interactive diagram: https://gitdiagram.com/saikiransangam/shakedown
- Repository: https://github.com/saikiransangam/shakedown

## Overview

Shakedown is a CLI load-testing and reliability-diagnosis tool, with a built-in fault-injecting API. Its run path configures an HTTP probe, drives concurrent or rate-limited requests, aggregates classified outcomes and timing, then prints a report with trend views and diagnostic findings. The graph also includes the separate mock-server workflow. Major edges are evidenced by the shown CLI calls, imports, and README workflow; unsampled implementation details are represented only where documented.

Main entry points: [`probe/http.go`](https://github.com/saikiransangam/shakedown/blob/main/probe/http.go) (HTTP probe), [`internal/cli/run.go`](https://github.com/saikiransangam/shakedown/blob/main/internal/cli/run.go) (Run options), [`internal/cli/mock.go`](https://github.com/saikiransangam/shakedown/blob/main/internal/cli/mock.go) (Mock options), [`internal/cli/cli.go`](https://github.com/saikiransangam/shakedown/blob/main/internal/cli/cli.go) (Command dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflows"]
  node_entry["Command entry<br/>[main.go]"]
  node_commands["Command dispatch<br/>[cli.go]"]
  node_runcli["Run options<br/>[run.go]"]
  node_mockcli["Mock options<br/>[mock.go]"]
end

subgraph group_probe["Request execution"]
  node_loadrun["Load driver<br/>[runner.go]"]
  node_httpprobe["HTTP probe<br/>[http.go]"]
end

subgraph group_metrics["Measurement"]
  node_outcomes["Outcome taxonomy<br/>[outcome.go]"]
  node_collector["Result collector<br/>[collector.go]"]
  node_distributions["Exact distributions<br/>[distribution.go]"]
  node_result["Request result<br/>[result.go]"]
end

subgraph group_report["Analysis and output"]
  node_textreport["Text report<br/>[text.go]"]
  node_format["Report formatting<br/>[format.go]"]
  node_diagnose["Run diagnosis<br/>[diagnose.go]"]
end

subgraph group_mock["Fault API"]
  node_mockprofiles["Fault profiles<br/>[server.go]"]
  node_mockserver["Mock HTTP server<br/>[server.go]"]
end

node_user(("CLI user"))
node_target(("Test target API"))

node_user -->|"runs command"| node_entry
node_entry -->|"dispatches"| node_commands
node_commands -->|"runs"| node_runcli
node_commands -->|"runs"| node_mockcli
node_runcli -->|"configures"| node_httpprobe
node_runcli -->|"starts"| node_loadrun
node_loadrun -->|"invokes"| node_httpprobe
node_httpprobe -->|"sends requests"| node_target
node_httpprobe -->|"classifies"| node_outcomes
node_httpprobe -->|"produces"| node_result
node_loadrun -->|"collects results"| node_collector
node_collector -->|"computes"| node_distributions
node_collector -->|"aggregates"| node_result
node_runcli -->|"renders summary"| node_textreport
node_textreport -->|"requests findings"| node_diagnose
node_textreport -->|"formats output"| node_format
node_user -->|"starts mock"| node_mockcli
node_mockcli -->|"selects profile"| node_mockprofiles
node_mockcli -->|"starts server"| node_mockserver
node_mockserver -.->|"serves API"| node_target

click node_entry "https://github.com/saikiransangam/shakedown/blob/main/cmd/shakedown/main.go"
click node_commands "https://github.com/saikiransangam/shakedown/blob/main/internal/cli/cli.go"
click node_runcli "https://github.com/saikiransangam/shakedown/blob/main/internal/cli/run.go"
click node_mockcli "https://github.com/saikiransangam/shakedown/blob/main/internal/cli/mock.go"
click node_loadrun "https://github.com/saikiransangam/shakedown/blob/main/load/runner.go"
click node_httpprobe "https://github.com/saikiransangam/shakedown/blob/main/probe/http.go"
click node_outcomes "https://github.com/saikiransangam/shakedown/blob/main/metrics/outcome.go"
click node_collector "https://github.com/saikiransangam/shakedown/blob/main/metrics/collector.go"
click node_distributions "https://github.com/saikiransangam/shakedown/blob/main/metrics/distribution.go"
click node_result "https://github.com/saikiransangam/shakedown/blob/main/metrics/result.go"
click node_textreport "https://github.com/saikiransangam/shakedown/blob/main/internal/report/text.go"
click node_format "https://github.com/saikiransangam/shakedown/blob/main/internal/report/format.go"
click node_diagnose "https://github.com/saikiransangam/shakedown/blob/main/internal/report/diagnose.go"
click node_mockprofiles "https://github.com/saikiransangam/shakedown/blob/main/mockapi/server.go"
click node_mockserver "https://github.com/saikiransangam/shakedown/blob/main/mockapi/server.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_entry,node_commands,node_runcli,node_mockcli,node_user toneBlue
class node_loadrun,node_httpprobe toneAmber
class node_outcomes,node_collector,node_distributions,node_result,node_target toneMint
class node_textreport,node_format,node_diagnose toneRose
class node_mockprofiles,node_mockserver toneIndigo
```

## Components

### CLI workflows

- [Command entry](https://github.com/saikiransangam/shakedown/blob/main/cmd/shakedown/main.go): `cmd/shakedown/main.go`
- [Command dispatch](https://github.com/saikiransangam/shakedown/blob/main/internal/cli/cli.go): `internal/cli/cli.go`
- [Run options](https://github.com/saikiransangam/shakedown/blob/main/internal/cli/run.go): `internal/cli/run.go`
- [Mock options](https://github.com/saikiransangam/shakedown/blob/main/internal/cli/mock.go): `internal/cli/mock.go`

### Request execution

- [Load driver](https://github.com/saikiransangam/shakedown/blob/main/load/runner.go): `load/runner.go`
- [HTTP probe](https://github.com/saikiransangam/shakedown/blob/main/probe/http.go): `probe/http.go`

### Measurement

- [Outcome taxonomy](https://github.com/saikiransangam/shakedown/blob/main/metrics/outcome.go): `metrics/outcome.go`
- [Result collector](https://github.com/saikiransangam/shakedown/blob/main/metrics/collector.go): `metrics/collector.go`
- [Exact distributions](https://github.com/saikiransangam/shakedown/blob/main/metrics/distribution.go): `metrics/distribution.go`
- [Request result](https://github.com/saikiransangam/shakedown/blob/main/metrics/result.go): `metrics/result.go`

### Analysis and output

- [Text report](https://github.com/saikiransangam/shakedown/blob/main/internal/report/text.go): `internal/report/text.go`
- [Report formatting](https://github.com/saikiransangam/shakedown/blob/main/internal/report/format.go): `internal/report/format.go`
- [Run diagnosis](https://github.com/saikiransangam/shakedown/blob/main/internal/report/diagnose.go): `internal/report/diagnose.go`

### Fault API

- [Fault profiles](https://github.com/saikiransangam/shakedown/blob/main/mockapi/server.go): `mockapi/server.go`
- [Mock HTTP server](https://github.com/saikiransangam/shakedown/blob/main/mockapi/server.go): `mockapi/server.go`

### Other components

- **CLI user**
- **Test target API**

## Connections

- CLI user → Command entry: runs command (evidence: `cmd/shakedown/main.go`)
- Command entry → Command dispatch: dispatches (evidence: `cmd/shakedown/main.go`)
- Command dispatch → Run options: runs
- Command dispatch → Mock options: runs
- Run options → HTTP probe: configures (evidence: `internal/cli/run.go`)
- Run options → Load driver: starts (evidence: `internal/cli/run.go`)
- Load driver → HTTP probe: invokes (evidence: `load/runner.go`)
- HTTP probe → Test target API: sends requests (evidence: `probe/http.go`)
- HTTP probe → Outcome taxonomy: classifies (evidence: `probe/http.go`)
- HTTP probe → Request result: produces (evidence: `probe/http.go`)
- Load driver → Result collector: collects results (evidence: `load/runner.go`)
- Result collector → Exact distributions: computes (evidence: `metrics/collector.go`)
- Result collector → Request result: aggregates (evidence: `metrics/collector.go`)
- Run options → Text report: renders summary (evidence: `internal/cli/run.go`)
- Text report → Run diagnosis: requests findings (evidence: `internal/report/text.go`)
- Text report → Report formatting: formats output (evidence: `internal/report/text.go`)
- CLI user → Mock options: starts mock (evidence: `README.md`)
- Mock options → Fault profiles: selects profile (evidence: `internal/cli/mock.go`)
- Mock options → Mock HTTP server: starts server (evidence: `internal/cli/mock.go`)
- Mock HTTP server → Test target API: serves API
