Hammer is an HTTP load-testing / load-generation tool. Its goals are to be high-performance and flexible. It consists of a CLI tool similar to apachebench (ab) or siege, and a library that can be used for more advanced scenarios.
go get github.com/vimeo/go-hammer/cli/hammer
Please read the documentation.
go get github.com/vimeo/go-hammer/hammer
import "github.com/vimeo/go-hammer/hammer"
h := hammer.Hammer{
RunFor: 30,
Threads: 10,
QPS: 100,
GenerateFunction: hammer.RandomURLGenerator(
hammer.RandomURLGeneratorOptions{
URLs: []string{"http://www.example.com"},
Name: "example"
},
),
}
statschan := make(chan hammer.StatsSummary)
go func() {
for stats := range statschan {
stats.PrintReport(os.Stdout)
}
}
h.Run(statschan)