Git Product home page Git Product logo

boomer's Introduction

boomer Build 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.

Install

go get github.com/myzhan/boomer

Zeromq support

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

Becase 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

Examples(main.go)

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

package main


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


func foo(){
	
    start := boomer.Now()
    time.Sleep(100 * time.Millisecond)
    elapsed := boomer.Now() - 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.Events.Publish("request_success", "http", "foo", elapsed, int64(10))
}


func bar(){
	
    start := boomer.Now()
    time.Sleep(100 * time.Millisecond)
    elapsed := boomer.Now() - 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.Events.Publish("request_failure", "udp", "bar", elapsed, "udp error")
}


func main(){

    task1 := &boomer.Task{
        Name: "foo",
        Weight: 10,
        Fn: foo,
    }

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

    boomer.Run(task1, task2)

}

Usage

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

If you want to limit max RPS(TPS) that boomer can generate.

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

If master is listening on zeromq socket.

locust -f dummy.py --master --master-bind-host=127.0.0.1 --master-bind-port=5557
go build -o a.out main.go
./a.out --master-host=127.0.0.1 --master-port=5557 --rpc=zeromq

If master is listening on tcp socket.

locust -f dummy.py --master --master-bind-host=127.0.0.1 --master-bind-port=5557
go build -o a.out main.go
./a.out --master-host=127.0.0.1 --master-port=5557 --rpc=socket

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.

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).

boomer's People

Contributors

myzhan avatar marrotte avatar coltonweaver avatar ntcong avatar

Watchers

James Cloos avatar zp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.