All Projects → myzhan → Boomer

myzhan / Boomer

Licence: mit
A better load generator for locust, written in golang.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Boomer

Web Tooling Benchmark
JavaScript benchmark for common web developer workloads
Stars: ✭ 290 (-60.49%)
Mutual labels:  performance, benchmark, performance-testing
Sysbench Docker Hpe
Sysbench Dockerfiles and Scripts for VM and Container benchmarking MySQL
Stars: ✭ 14 (-98.09%)
Mutual labels:  performance, benchmark, performance-testing
Gatling Dubbo
A gatling plugin for running load tests on Apache Dubbo(https://github.com/apache/incubator-dubbo) and other java ecosystem.
Stars: ✭ 131 (-82.15%)
Mutual labels:  performance, benchmark, performance-testing
Performance Testing Framework
Framework allows to perform load testing with Apache Jmeter, view application/server metrics in real-time with Grafana, analyze errors cause with detailed traces for failed requests, compare different test runs in scripted dashboard and perform frontend performance testing with sitespeed.io+webpagetest
Stars: ✭ 275 (-62.53%)
Mutual labels:  performance, performance-testing
best
🏆 Delightful Benchmarking & Performance Testing
Stars: ✭ 73 (-90.05%)
Mutual labels:  benchmark, performance-testing
IGUANA
IGUANA is a benchmark execution framework for querying HTTP endpoints and CLI Applications such as Triple Stores. Contact: [email protected]
Stars: ✭ 22 (-97%)
Mutual labels:  benchmark, performance-testing
Speedracer
Collect performance metrics for your library/application.
Stars: ✭ 1,868 (+154.5%)
Mutual labels:  performance, performance-testing
Performance
⏱ PHP performance tool analyser your script on time, memory usage and db query. Support Laravel and Composer for web, web console and command line interfaces.
Stars: ✭ 429 (-41.55%)
Mutual labels:  performance, performance-testing
Fperf
Framework of performance testing
Stars: ✭ 316 (-56.95%)
Mutual labels:  performance, benchmark
Rspec Benchmark
Performance testing matchers for RSpec
Stars: ✭ 460 (-37.33%)
Mutual labels:  benchmark, performance-testing
Youku Sdk Tool Woodpecker
In-app-debug tool for iOS
Stars: ✭ 600 (-18.26%)
Mutual labels:  performance, performance-testing
Quickperf
QuickPerf is a testing library for Java to quickly evaluate and improve some performance-related properties
Stars: ✭ 231 (-68.53%)
Mutual labels:  performance, performance-testing
Are We Fast Yet
Are We Fast Yet? Comparing Language Implementations with Objects, Closures, and Arrays
Stars: ✭ 161 (-78.07%)
Mutual labels:  performance, benchmark
Kubestone
Performance benchmarks for Kubernetes
Stars: ✭ 159 (-78.34%)
Mutual labels:  performance, benchmark
Inspectit
inspectIT is the leading Open Source APM (Application Performance Management) tool for analyzing your Java (EE) applications.
Stars: ✭ 513 (-30.11%)
Mutual labels:  performance, performance-testing
Web Frameworks
Which is the fastest web framework?
Stars: ✭ 6,125 (+734.47%)
Mutual labels:  performance, benchmark
Pyperformance
Python Performance Benchmark Suite
Stars: ✭ 406 (-44.69%)
Mutual labels:  performance, benchmark
Frameworkbenchmarks
Source for the TechEmpower Framework Benchmarks project
Stars: ✭ 6,157 (+738.83%)
Mutual labels:  performance, benchmark
Deli
Stars: ✭ 148 (-79.84%)
Mutual labels:  performance, performance-testing
Fortio
Fortio load testing library, command line tool, advanced echo server and web UI in go (golang). Allows to specify a set query-per-second load and record latency histograms and other useful stats.
Stars: ✭ 2,199 (+199.59%)
Mutual labels:  performance, performance-testing

boomer Build Status Go Report Card Coverage Status Documentation Status

Links

Description

Boomer is a better load generator for locust, written in golang. It can spawn thousands of goroutines to run your code concurrently.

It will listen and report to the locust master automatically, your test results will be displayed on the master's web UI.

Use it as a library, not a general-purpose benchmarking tool.

Install

go get github.com/myzhan/boomer

Build

Boomer use gomq by default, which is a pure Go implementation of the ZeroMQ protocol.

Because of the instability of gomq, you can switch to goczmq.

# use gomq
go build -o a.out main.go
# use goczmq
go build -tags 'goczmq' -o a.out main.go

If you fail to compile boomer with gomq, try to update gomq first.

go get -u github.com/zeromq/gomq

Examples(main.go)

This is a example of boomer's API. You can find more in the "examples" directory.

package main

import "time"
import "github.com/myzhan/boomer"

func foo(){
    start := time.Now()
    time.Sleep(100 * time.Millisecond)
    elapsed := time.Since(start)

    /*
    Report your test result as a success, if you write it in locust, it will looks like this
    events.request_success.fire(request_type="http", name="foo", response_time=100, response_length=10)
    */
    boomer.RecordSuccess("http", "foo", elapsed.Nanoseconds()/int64(time.Millisecond), int64(10))
}

func bar(){
    start := time.Now()
    time.Sleep(100 * time.Millisecond)
    elapsed := time.Since(start)

    /*
    Report your test result as a failure, if you write it in locust, it will looks like this
    events.request_failure.fire(request_type="udp", name="bar", response_time=100, exception=Exception("udp error"))
    */
    boomer.RecordFailure("udp", "bar", elapsed.Nanoseconds()/int64(time.Millisecond), "udp error")
}

func main(){
    task1 := &boomer.Task{
        Name: "foo",
        // The weight is used to distribute goroutines over multiple tasks.
        Weight: 10,
        Fn: foo,
    }

    task2 := &boomer.Task{
        Name: "bar",
        Weight: 20,
        Fn: bar,
    }

    boomer.Run(task1, task2)
}

Run

For debug purpose, you can run tasks without connecting to the master.

go build -o a.out main.go
./a.out --run-tasks foo,bar

Otherwise, start the master using the included dummy.py.

locust --master -f dummy.py

--max-rps means the max count that all the Task.Fn can be called in one second.

The result may be misleading if you call boomer.RecordSuccess() more than once in Task.Fn.

go build -o a.out main.go
./a.out --max-rps 10000

If you want the RPS increase from zero to max-rps or infinity.

go build -o a.out main.go
# The default interval is 1 second
./a.out --request-increase-rate 10
# Change the interval to 1 minute
# Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h"
./a.out --request-increase-rate 10/1m

So far, dummy.py is necessary when starting a master, because locust needs such a file.

Don't worry, dummy.py has nothing to do with your test.

Profiling

You may think there are bottlenecks in your load generator, don't hesitate to do profiling.

Both CPU and memory profiling are supported.

It's not suggested to run CPU profiling and memory profiling at the same time.

CPU Profiling

# 1. run locust master.
# 2. run boomer with cpu profiling for 30 seconds.
$ go run main.go -cpu-profile cpu.pprof -cpu-profile-duration 30s
# 3. start test in the WebUI.
# 4. run pprof.
$ go tool pprof cpu.pprof
Type: cpu
Time: Nov 14, 2018 at 8:04pm (CST)
Duration: 30.17s, Total samples = 12.07s (40.01%)
Entering interactive mode (type "help" for commands, "o" for options)
(pprof) web

Memory Profiling

# 1. run locust master.
# 2. run boomer with memory profiling for 30 seconds.
$ go run main.go -mem-profile mem.pprof -mem-profile-duration 30s
# 3. start test in the WebUI.
# 4. run pprof and try 'go tool pprof --help' to learn more.
$ go tool pprof -alloc_space mem.pprof
Type: alloc_space
Time: Nov 14, 2018 at 8:26pm (CST)
Entering interactive mode (type "help" for commands, "o" for options)
(pprof) top

Exporter

If you are not satisfied with the build-in web monitor in Locust, you can run prometheus_exporter.py instead of dummy.py as your master.

Try this

locust --master -f prometheus_exporter.py

Thanks to Prometheus and Grafana, you will get an awesome dashboard: Locust for Prometheus

Contributing

If you are enjoying boomer and willing to add new features to it, you are welcome.

Also, good examples are welcome!!!

License

Open source licensed under the MIT license (see LICENSE file for details).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].