haggar

command module
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 12 Imported by: 0

README

haggar test

An experimental carbon load generation tool named after Haggar the Witch, a real menace to Voltron.

It's also named after pants.

It behaves like a swarm of collectd agents firing a fixed number of metrics at a fixed interval to your carbon-compatible endpoint. The number of agents increases over time until a maximum number is reached. At any given time, you can pause the spawning of new agents by sending SIGUSR1. Spawning can be resumed by doing the same.

Installation

$ go install github.com/gorsuch/haggar@latest

Prebuilt binaries for Linux and macOS (amd64 and arm64) are attached to each release.

Or run it with Docker:

$ docker run --rm ghcr.io/gorsuch/haggar -carbon=graphite.example.com:2003

Usage

$ haggar -carbon=graphite.example.com:2003 -agents=50 -metrics=1000

Toggle spawning of new agents on and off while it runs:

$ kill -USR1 <pid>   # pid is logged at startup as "master: pid N"

Command-line flags

$ haggar -h
Usage of haggar:
  -agents int
    	max number of agents to run concurrently (default 100)
  -cache_connections
    	if set, keep connections open between flushes (default: false)
  -carbon string
    	address of carbon host (default "localhost:2003")
  -flush-interval duration
    	how often to flush metrics (default 10s)
  -jitter duration
    	max amount of jitter to introduce in between agent launches (default 10s)
  -metrics int
    	number of metrics for each agent to hold (default 10000)
  -prefix string
    	prefix for metrics (default "haggar")
  -spawn-interval duration
    	how often to gen new agents (default 10s)
  -timeout duration
    	max time to connect to carbon, and to write each flush (0 = no timeout) (default 5s)

Metrics are named <prefix>.agent.<id>.metrics.<n> and sent in the carbon plaintext format (name value timestamp), with random values from 0 to 999.

Development

Go is managed with mise:

$ mise install       # installs the pinned Go toolchain
$ mise run test      # go vet + go test
$ mise run build     # builds bin/haggar-<os>-<arch>

Credits

This tool was designed and developed by @gorsuch and @obfuscurity.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL