Giter Club home page Giter Club logo

boomer's Introduction

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.

Versioning

Boomer used to support all versions of locust, even if locust didn't keep backward compatibility.

Now boomer follows locust's versioning, and the master branch works with locust's master branch.

If locust introduces breaking changes, boomer will have a tagged version that works previous version of locust.

Install

# Install the master branch
$ go get github.com/myzhan/boomer@master
# Install a tagged version that works with locust 1.6.0
$ go get github.com/myzhan/[email protected]

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

boomer's People

Contributors

andydunstall avatar bugvanisher avatar coltonweaver avatar crafter76 avatar debugtalk avatar dipjyotimetia avatar johannesg avatar joshprzybyszewski-wf avatar lmars avatar marrotte avatar mynextweekend avatar myzhan avatar ntcong avatar solxnp avatar tcolgate avatar yuyongid avatar zezhehh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

boomer's Issues

goroutine exception

Ubuntu 16.04
go1.10 linux/amd64

Running this server:

package main

import (
	"log"
	"net/http"
	"sync/atomic"
	"time"
)

func main() {
	count := uint64(0)
	tick := time.NewTicker(time.Second)
	http.ListenAndServe(":6060", http.HandlerFunc(
		func(w http.ResponseWriter, r *http.Request) {
			atomic.AddUint64(&count, 1)
			select {
			case <-tick.C:
				log.Printf("Rate: %d", atomic.SwapUint64(&count, 0))
			default:
			}
		},
	))
}

With this test:

package main

import (
	"github.com/myzhan/boomer"
	"net/http"
)

func urlBash() {
	start := boomer.Now()

	localServer := "http://localhost:6060"
	resp, _ := http.Get(localServer)

	elapsed := boomer.Now() - start

	var result string
	if resp.StatusCode == 200 {
		result = "request_success"
	} else {
		result = "request_failure"
	}

	boomer.Events.Publish(result, "http", "urlBash", elapsed, int64(10))

}

func main() {

	task := &boomer.Task{
		Name: "urlBash",
		Fn:   urlBash,
	}

	boomer.Run(task)
}

Exception

goroutine 50 [running]:
runtime/debug.Stack(0x0, 0x0, 0x0)
        /usr/lib/go-1.6/src/runtime/debug/stack.go:24 +0x80
runtime/debug.PrintStack()
        /usr/lib/go-1.6/src/runtime/debug/stack.go:16 +0x18
github.com/myzhan/boomer.(*runner).safeRun.func1()
        /home/ubuntu/go/src/github.com/myzhan/boomer/runner.go:47 +0x53
panic(0x9b10e0, 0xc82000e0d0)
        /usr/lib/go-1.6/src/runtime/panic.go:443 +0x4e9
main.urlBash()
        /home/ubuntu/go/src/github.com/bbc/locust-load-tests/examples/urlbash/main.go:17 +0x75
github.com/myzhan/boomer.(*runner).safeRun(0xc820142120, 0xba2300)
        /home/ubuntu/go/src/github.com/myzhan/boomer/runner.go:51 +0x3a
github.com/myzhan/boomer.(*runner).spawnGoRoutines.func1(0xc820190060, 0xc820142120, 0xba2300)
        /home/ubuntu/go/src/github.com/myzhan/boomer/runner.go:91 +0xd5
created by github.com/myzhan/boomer.(*runner).spawnGoRoutines
        /home/ubuntu/go/src/github.com/myzhan/boomer/runner.go:95 +0x497

[Feature] --duration flag

I was thinking of a test duration flag (--duration=10m, -d=10m). This I think would just be a matter of a timer and an os.Exit(0). What are your opinions?

panic when run test

panic: runtime error: index out of range

goroutine 3584 [running]:
github.com/zeromq/gomq.(*Socket).Recv(...)
/Users/zhangzhen/serverproj/src/github.com/zeromq/gomq/socket.go:115
github.com/myzhan/boomer.(*gomqSocketClient).recv(0xc42026ec20)
/Users/zhangzhen/serverproj/src/github.com/myzhan/boomer/client_gomq.go:86 +0x115
created by github.com/myzhan/boomer.newZmqClient
/Users/zhangzhen/serverproj/src/github.com/myzhan/boomer/client_gomq.go:79 +0x717

tcp 连接并不平均

描述: 使用boomer进行socket压测,如果定义每秒100个用户的话,通过抓包发现boomer生成的客户端在每秒的前100ms就把100个用户都创建完毕并建立连接了。并等到下一个1s的到来,也会在前100ms创建完成。

问题: 这样的测试效果就不是100人/s,而是1人/ms,这样对被测服务器考验是不一样的。

建议: 根据master的每秒并发数,将goroutine的生成时间间隔平均到整个1s中,而不是集中在1s的最前面全部生成。

out of memory

./a.out --master-host=127.0.0.1 --master-port=5557 --rpc=socket
2018/06/21 14:57:20 Boomer is built with gomq support.
2018/06/21 14:57:20 Boomer is connected to master(127.0.0.1:5557) press Ctrl+c to quit.
fatal error: runtime: out of memory

内存不足????

是否考虑暴露一个API引出master下发的stop指令

在Fn的函数调用了自己的socket client,拉起了多个goroutine来处理收发包和心跳维持。boomer能正常拉起所有客户端。
但是,收到master的stop消息的时候,这些拉起的goroutine没有办法获取到这个stop指令,无法停止。

停止 locust master 的时候,出现 panic

locust master 停止的时候出现了个 panic,大佬来处理一下吗?

16:14:15 client_gomq.go:72: runtime error: index out of range
goroutine 67 [running]:
runtime/debug.Stack(0xc000084000, 0x2, 0xc00021e0c0)
        /usr/local/go/src/runtime/debug/stack.go:24 +0xa7
runtime/debug.PrintStack()
        /usr/local/go/src/runtime/debug/stack.go:16 +0x22
github.com/myzhan/boomer.(*gomqSocketClient).recv.func1()
        /Users/yuongID/go/pkg/mod/github.com/myzhan/[email protected]/client_gomq.go:73 +0x94
panic(0x98d220, 0xeb98d0)
        /usr/local/go/src/runtime/panic.go:513 +0x1b9
github.com/zeromq/gomq.(*Socket).Recv(...)
        /Users/yuongID/go/pkg/mod/github.com/zeromq/[email protected]/socket.go:115
github.com/myzhan/boomer.(*gomqSocketClient).recv(0xc0001ac0a0)
        /Users/yuongID/go/pkg/mod/github.com/myzhan/[email protected]/client_gomq.go:79 +0x1b2
created by github.com/myzhan/boomer.(*gomqSocketClient).connect
        /Users/yuongID/go/pkg/mod/github.com/myzhan/[email protected]/client_gomq.go:55 +0x6ad
16:14:15 client_gomq.go:74: The underlying socket connected to master(172.16.16.72:5558) may be broken, please restart both locust and boomer

after set users and hatch rate, app crashed

i have 13 slave, and when i set user to 1300 and hatch rate to 20, them my app which boomer crashed 。 give me some information as below:

2017/12/18 17:19:41 runner.go:56: Hatching and swarming 12 clients at the rate 0 clients/s...
panic: runtime error: integer divide by zero

goroutine 22 [running]:
github.com/myzhan/boomer.(*runner).spawnGoRoutines(0xc42012f6e0, 0xc, 0xc42013c120)
        /Users/jet/GoPath/src/github.com/myzhan/boomer/runner.go:73 +0x646
github.com/myzhan/boomer.(*runner).startHatching(0xc42012f6e0, 0xc, 0x0)
        /Users/jet/GoPath/src/github.com/myzhan/boomer/runner.go:122 +0x13f
github.com/myzhan/boomer.(*runner).getReady.func1(0xc42012f6e0)
        /Users/jet/GoPath/src/github.com/myzhan/boomer/runner.go:169 +0x2c2
created by github.com/myzhan/boomer.(*runner).getReady
        /Users/jet/GoPath/src/github.com/myzhan/boomer/runner.go:179 +0x68
[jet@localhost perforceTest]$ ./transfer-benchmark_linux_amd64    --master-host=127.0.0.1 --master-port=5557  --rpc=zeromq

[Question] Need recommendations for HTTP Load test planning

First, I would like to thank you for this amazing library. Second I need your help in planning my load test in a way that my load generator is not the limiting factor in the performance.

I have written test in following way

func task(){
//request created
     startTime := boomer.Now() \\  1
     response, err := client.Do(request) \\ 2
     elapsed := boomer.Now() - startTime \\ 3
//Close response, report to boomer
}

Now There are several factors as I understand, I need to take care of

  1. Any inefficiency in lines 1,2,3 will affect the time reported. This has to be as efficient as we get
  2. Inefficiency any other place will drop the RPS.

Since I am doing a distributed load test, I have control to increase number of slaves. So RPS is something I could easily boost. In statements [1,2,3] things can get slower when we do request. If I am right, I need to optimize this part right.

I am using keep-alive and pooled connections, but how to determine the correct number of pooled connections I should have. Is it > number of users/ number of slave. I am also planning to use fasthttp client.

Any other recommendation or strategy to follow to have minimum performance impact due to client. I am aiming to hit 100 rps 100K rps.

weight is misleading

in the locustio python version, the weight is how frequently a task get run. for example, if someone has 2 tasks, each has weight of 1, then each get 50% of chances to run.

in Boomer, this seems to be different. what i observed is that even if i have 2 tasks, each has weight of 1, if task 1 takes average 5 ms to run while task 2 takes average 10 ms to run, then task 1 will have 2x of RPS compared with task 2. this makes it very hard to do io test when someone want to have 80% write and 20% read for example. (btw, i started writing a go version of s3 test code https://github.com/twosigma/locust-s3/blob/master/locustfiles/go/s3.go. your package is great. thank you!)

i guess the weight here seems to how many coroutines will be initialized? have not check boomer source code yet.

请问我为啥提示端口被关闭错误?

大神你好,最近在折腾locust,发现rps和rt差强人意,同等条件下比loadrunner差5~10倍;所以想采用您的这个golang写的组件,但是我在使用过程中发现以下问题,还望赐教:
1.首先我按照你的方法启动了管理机:
D:\temp\code\src\github.com\myzhan\boomer>locust -f dummy.py --master --master-bind-host=10.25.24.185 --master-bind-port=5557
[2017-06-20 16:18:06,955] CNHQ-14110502N/INFO/locust.main: Starting web monitor at *:8089
[2017-06-20 16:18:06,958] CNHQ-14110502N/INFO/locust.main: Starting Locust 0.8a2
2.然后我在负载机上启动,但是提示错误:
E:\gobox>ls.out --master-host=10.25.24.185 --master-port=5557
2017/06/20 16:18:16 Boomer is built without zeromq support. We recommend you to
install the goczmq package, and build Boomer with zeromq when running in distrib
uted mode.
2017/06/20 16:18:16 Boomer is connected to master(10.25.24.185:5557) press Ctrl+
c to quit.
2017/06/20 16:18:17 read tcp 10.24.51.236:51072->10.25.24.185:5557: wsarecv: An
existing connection was forcibly closed by the remote host.

看上去是管理机主动关闭了链接的端口,我换了其他端口也是一样的,请问为什么?

locust+boomer进行grpc压测的咨询

Describe the bug
你好,
我在进行gprc接口的压测,在公司虚拟机环境中尝试用了locust/jmeter,但6台机器所产生的最高请求量只有约7w/s,希望能用找一种能提供更高并发量、模拟很多用户的解决方案。 偶然看到本项目,希望能用boomer+locust进行grpc压测,下面这种方式可行吗?
(单连接不断发请求^_^)

Expected behavior

package main
import boomer "github.com/myzhan/boomer"

import (
	"context"
	"demo/HelloWorld"
	"google.golang.org/grpc"
)

func grpc_test(){
    conn, err := grpc.Dial("10.187.160.26:10002", grpc.WithInsecure())

    if err != nil {
       boomer.Events.Publish("request_failure","Connection","grpc",0.0,err)   
    }

    defer conn.Close()
    c := rpcdemo_service.NewHelloWorldServiceClient(conn)        // get the connection

    // for-loop
    for {
        startTime := boomer.Now()
        ctx := context.Background()
        res, err := c.SayHello(ctx, &rpcdemo_service.Person{FirstName: "first_name", LastName: "last_name", Time: "5"})
        endTime := boomer.Now()

        if err != nil {
            boomer.Events.Publish("request_failure","SayHello", res ,0.0,err.Error())
        } else {
            boomer.Events.Publish("request_success","SayHello","grpc", 0.0, int64(endTime - startTime))
        }
    }
}

```
func main() {
    task :=&boomer.Task{ Name:"grpc_test", Fn:grpc_test, }
    boomer.Run(task)
}
```

我们多台主机,每个主机部署一个master或slave,无论是启动单个slave,还是启动多个slave,模拟的user数量大概在1000左右。再多则连结报错。

Msgpack encode fail: msgpack encode error

I run example code bommer:

func foo() {
	start := boomer.Now()
	time.Sleep(100 * time.Millisecond)
	elapsed := boomer.Now() - start
	boomer.RecordSuccess("http", "foo", elapsed, int64(10))
}

func bar() {
	start := boomer.Now()
	time.Sleep(100 * time.Millisecond)
	elapsed := boomer.Now() - start
	boomer.RecordFailure("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)
}

But I encountered an error like this:

Msgpack encode fail: msgpack encode error: runtime error: invalid memory address or nil pointer dereference

Boomer is built with gomq support.
Boomer is connected to master(127.0.0.1:5557|5558) press Ctrl+c to quit.
Hatching and swarming 10 clients at the rate 1 clients/s...
Msgpack encode fail: msgpack encode error: runtime error: invalid memory address or nil pointer dereference

I do not understand what happened.

Publish函数一直在panic

boomer.Events.Publish("request_success", "query", "tcp", int64(costTime), "hello")

goroutine 24 [running]:
runtime/debug.Stack(0xc42011c360, 0x1010772, 0xc4201120d0)
/usr/local/Cellar/go/1.8.1/libexec/src/runtime/debug/stack.go:24 +0x79
runtime/debug.PrintStack()
/usr/local/Cellar/go/1.8.1/libexec/src/runtime/debug/stack.go:16 +0x22
github.com/myzhan/boomer.(*runner).safeRun.func1()
/Users/zhongtenghui/go/src/github.com/myzhan/boomer/runner.go:43 +0x6e
panic(0x1472200, 0xc420110bb0)
/usr/local/Cellar/go/1.8.1/libexec/src/runtime/panic.go:489 +0x2cf
reflect.Value.call(0x148eac0, 0x1550b28, 0x13, 0x15383c6, 0x4, 0xc42016efc0, 0x4, 0x4, 0xc420110ba0, 0xc42016efc0, ...)
/usr/local/Cellar/go/1.8.1/libexec/src/reflect/value.go:371 +0x1094
reflect.Value.Call(0x148eac0, 0x1550b28, 0x13, 0xc42016efc0, 0x4, 0x4, 0xc42016efc0, 0x4, 0x4)
/usr/local/Cellar/go/1.8.1/libexec/src/reflect/value.go:302 +0xa4
github.com/asaskevich/EventBus.(*EventBus).doPublish(0xc420122380, 0xc42011c330, 0x153f633, 0xf, 0xc420116a00, 0x4, 0x4)
/Users/zhongtenghui/go/src/github.com/asaskevich/EventBus/event_bus.go:158 +0xa8
github.com/asaskevich/EventBus.(*EventBus).Publish(0xc420122380, 0x153f633, 0xf, 0xc420116a00, 0x4, 0x4)
/Users/zhongtenghui/go/src/github.com/asaskevich/EventBus/event_bus.go:144 +0x331
main.query()
/Users/zhongtenghui/go/src/gf.com.cn/NewQuote/secu_search/benchmark/main.go:28 +0x2e2
github.com/myzhan/boomer.(*runner).safeRun(0xc4201323c0, 0x1551f08)
/Users/zhongtenghui/go/src/github.com/myzhan/boomer/runner.go:47 +0x43
github.com/myzhan/boomer.(*runner).spawnGoRoutines.func1(0xc420024480, 0xc4201323c0, 0x1551f08)
/Users/zhongtenghui/go/src/github.com/myzhan/boomer/runner.go:85 +0x61
created by github.com/myzhan/boomer.(*runner).spawnGoRoutines
/Users/zhongtenghui/go/src/github.com/myzhan/boomer/runner.go:88 +0x3d7

Get http://localhost:8080: read tcp [::1]:53942->[::1]:8080: read: connection reset by peer

Describe the bug
I am running the test described in this repo

To Reproduce
Steps to reproduce the behavior:

  1. go get -u github.com/myzhan/boomer
  2. go run server.go
  3. locust -f dummy.py --master --master-bind-host=127.0.0.1 --master-bind-port=5557
  4. go build -o a.out urlbash.go
  5. ./a.out --request-increase-rate 10 --max-rps 1000
    --master-host=127.0.0.1 --master-port=5557 --rpc=zeromq
  6. http://localhost:8089
  7. Set a 1000 users with a hatch rate of 10 (not sure how this interacts with the new flags)

Expected behavior
10 requests per second up to 1000 RPS

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: macOS Sierra
  • Go Version: go version go1.10 darwin/amd64

boomer收到master的quit命令,boomer退出之前忘记发布 “boomer:quit”事件

由于我的测试用例有用到其他的 master 保存 client 的状态,当 locust 的 master 退出之后,下发给 boomer quite 操作,boomer 能正常让拉起的 client 退出。

但是,由于 boomer 没有发布 boomer:quit 事件,所以client 在自己退出的时候,没有做好状态清除的工作( client 通过订阅 boomer:quit来触发)导致其他的 master 没有正常清除掉这个 client。

log.Println("Got quit message from master, shutting down...")

Locust metrics issue

I am running boomer against a local [web server | https://github.com/bbc/locust-load-tests/blob/master/server/server.go]. The server is being hit, but metrics aren't being send to the Locust Master Here is the [test| https://github.com/bbc/locust-load-tests/blob/master/examples/urlbash/urlbash.go]. The example in this repo works fine.

error exit

I totally followed your ReadMe to run the example main.go, but get "exit status 1".
screen shot 2017-05-03 at 12 03 23 am

can not connect with ubuntu 18.04

Describe the bug
it looks like boomer can not connect to a locust under Ubuntu 18.04. same setup works with Ubuntu 16.04.

To Reproduce

run with strace. it unclear to me why it tried 5557 and immediately try to connect 5558.

strace: Process 6282 attached
2019/03/20 01:43:33 Boomer is built with gomq support.
[pid 6272] connect(3, {sa_family=AF_INET, sin_port=htons(5557), sin_addr=inet_addr("10.142.0.2")}, 16) = -1 EINPROGRESS (Operation now in progress)
[pid 6272] connect(5, {sa_family=AF_INET, sin_port=htons(5558), sin_addr=inet_addr("10.142.0.2")}, 16) = -1 EINPROGRESS (Operation now in progress)
[pid 6272] connect(5, {sa_family=AF_INET, sin_port=htons(5558), sin_addr=inet_addr("10.142.0.2")}, 16) = -1 EINPROGRESS (Operation now in progress)
[pid 6274] connect(5, {sa_family=AF_INET, sin_port=htons(5558), sin_addr=inet_addr("10.142.0.2")}, 16) = -1 EINPROGRESS (Operation now in progress)
[pid 6272] connect(5, {sa_family=AF_INET, sin_port=htons(5558), sin_addr=inet_addr("10.142.0.2")}, 16) = -1 EINPROGRESS (Operation now in progress)

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: [e.g. centos]
  • Go Version: [e.g. 1.10]

Additional context
Add any other context about the problem here.

Unexpected RPS

I am testing out your driver under this project. I am running the local Go server and setting a 1000 users to simulate with a hatch rate of 1. The request rate is highly fluctuating. I have tested a local Go server with Vegeta at ~30,000 RPS. I would also expect the request rate to increment up to 1000.

[Feature Request] Every flag for minute pacing?

We have —request-increase-rate and --max-rps which is great. But I wonder if we add another command line flag --every.

So, I have an example that would increase by 10 messages (SQS) every X number of minutes.

E.g. —request-increase-rate 10 —every 5m

That will go on until I either manually stop the test through the GUI or use the new Locust time duration flag.

Willing to pay bounty.

使用locust+boomer时不确定的小问题

在locust+boomer的框架下有2个小问题:

  1. 在locust里, 一个Locust类代表一个用户,然后可以在类变量里定义用户执行的任务集以及任务之间最大/最小等待时间,这些在boomer中的怎么体现? 我猜想在boomer中,一个boomer实例就是一个用户,但不确定

  2. 假设定义用户数是100,boomer创建100个用户之后是什么时候销毁这100个用户,是在完成一次task之后还是在测试完成之后?

【Question】No statistics info found

I tried your ideal, it was great.'
There's still a question, how to get the statistical info on performance metrics, like qps, response time?
When boomer is running, the statistics info on the GUI is none.

./a.out --run-tasks foo,bar will panic

./a.out --run-tasks foo,bar with the example will panic.

anic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x16c6894]

goroutine 1 [running]:
github.com/myzhan/boomer.(*Boomer).RecordSuccess(...)
/Users/mingzhang/go/src/github.com/myzhan/boomer/boomer.go:71
github.com/myzhan/boomer.RecordSuccess(...)
/Users/mingzhang/go/src/github.com/myzhan/boomer/boomer.go:175
main.getService()
/Users/mingzhang/work/locust-s3/locustfiles/go/s3.go:35 +0x154
github.com/myzhan/boomer.runTasksForTest(0xc0001605a0, 0x2, 0x2)
/Users/mingzhang/go/src/github.com/myzhan/boomer/boomer.go:115 +0x1e3
github.com/myzhan/boomer.Run(0xc0001605a0, 0x2, 0x2)
/Users/mingzhang/go/src/github.com/myzhan/boomer/boomer.go:130 +0x4a9
main.main()

the reason is that we have no defaultboomer created yet.

Expose runner type

Hello,

First of all, thanks for your awesome work!

I'd like to ask whether you have any plans about exposing the runner type, defined in runner.go.
As of now, there is a single instance of it, called defaultRunner, which can be controlled by passing flags during command startup, e.g.

example -maxRPS=10 -master-host=12.34.56.78

I find this to be limiting, becasue

  • it ties me to use the Go's standard library flag package
  • it is not possible to control any of the options programatically
  • it is not possible to change any of the internal dependencies of the runner, e.g. the used logger

Please do let me know if you need any additional details.
Thanks,
Ivan

Prometheus and Grafana

I was thinking of writing some documentation on Prometheus, exporters and Grafana and submit a PR. WDYT? The idea I suppose is to bypass the Locust UI. I think the node and stats exporter could be exampled. As you mention the swarm rate is go routines and we have the max rate built in via your flag.

Locust 0.11.0 support

Describe the bug
Locust 0.11.0 introduce heartbeat mechanism between master and slave. As boomer clients are required to send heartbeats, master will consider them out of sync.

unkown panic

2016/08/11 14:29:01 Hatching and swarming 1000 clients at the rate 1000 clients/s...
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x4623d8]

goroutine 22 [running]:
panic(0x9a00e0, 0xc820010120)
/home/zhanqp/local/go/src/runtime/panic.go:481 +0x3e6
github.com/myzhan/boomer.(*StatsEntry).log(0x0, 0x408b7a432d4a44dd, 0xa)
/home/zhanqp/src/gowork/src/github.com/myzhan/boomer/stats.go:78 +0x18
github.com/myzhan/boomer.init.2.func1()
/home/zhanqp/src/gowork/src/github.com/myzhan/boomer/stats.go:255 +0x103
created by github.com/myzhan/boomer.init.2
/home/zhanqp/src/gowork/src/github.com/myzhan/boomer/stats.go:262 +0x111
exit status 2

Could not connect to locust master using example scenario

I have tried to play around with https://github.com/myzhan/boomer/blob/master/examples/main.go
and for some reason I could not connect to locust master on localhost:

➜  loc go run main.go
2017/06/26 14:42:17 Boomer is built without zeromq support. We recommend you to install the goczmq package, and build Boomer with zeromq when running in distributed mode.
2017/06/26 14:42:17 Boomer is connected to master(127.0.0.1:5557) press Ctrl+c to quit.
2017/06/26 14:42:17 read tcp 127.0.0.1:58016->127.0.0.1:5557: read: invalid argument
exit status 1
➜  loc sudo lsof -i :5557
COMMAND     PID    USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
python2.7 94417 ****   16u  IPv4 0x95313e37ccf82897      0t0  TCP *:5557 (LISTEN)
[INFO] [root._exec:219] Cmd : locust --host private-network-host -c 1 -r 1.0 -n 1 -f ../dummy.py  --master --master-bind-host=0.0.0.0 --master-bind-port=5557

[2017-06-23 13:21:20,804].   /INFO/stdout: GRAFANA_TAG=generic
[2017-06-23 13:21:20,804]. /INFO/stdout:
[2017-06-23 13:21:20,820]. /INFO/locust.main: Starting web monitor at *:8089
[2017-06-23 13:21:20,821]. /INFO/locust.main: Starting Locust 0.7.5

Connection problem with slave

Steps

$ locust -f dummy.py --master --master-bind-host=127.0.0.1 --master-bind-port=5557
2018-03-28 13:15:53,561] mc-s092475.local/INFO/locust.main: Starting web monitor at *:8089
[2018-03-28 13:15:53,562] mc-s092475.local/INFO/locust.main: Starting Locust 0.8.1

# different pane
# running readme example
$ go build -o a.out main.go
$ ./a.out --master-host=127.0.0.1 --master-port=5557 --rpc=socket
2018/03/28 13:22:27 Boomer is built with gomq support.
2018/03/28 13:22:27 Boomer is connected to master(127.0.0.1:5557) press Ctrl+c to quit.
2018/03/28 13:22:27 EOF

$ open http://localhost:8089/
# set users and hatch rate

$ You are running in distributed mode but have no slave servers connected. Please connect slaves prior to swarming.

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.