pinterest / bender Goto Github PK
View Code? Open in Web Editor NEWAn easy-to-use library for creating load testing applications
License: Apache License 2.0
An easy-to-use library for creating load testing applications
License: Apache License 2.0
This is the version of thrift I used to generate the go code:
$ git rev-parse HEAD
808d143245f4f5c30600fab31cf9db854cbf5b48
This is the error I get when I compile the load test example:
# github.com/pinterest/bender/thrift
src/github.com/pinterest/bender/thrift/thrift.go:41: multiple-value tFac.GetTransport() in single-value context
PR incoming.
The bender library came out before most of the major improvements to the Go GC algorithms, and it is likely to perform a lot better with those improvements. It would be great to go back and revisit those numbers with a more modern Go implementation.
Hi,
I have a problem.When i execute "go install github.com/pinterest/hellothrift/client" according to the README.md ,it throws an error:
../client/main.go:23: cannot use "hello,world!" (type string) as type *string in assignment
How to solve this problem ?
Hoping for your answer.
Thks.
Hi.
I am experiencing some issues, while building your project.
~/bender/thrift$ go build
thrift.go:24:2: cannot find package "git.apache.org/thrift.git/lib/go/thrift" in any of:
/home/oceanfish81/gollvm_dist/src/git.apache.org/thrift.git/lib/go/thrift (from $GOROOT)
/home/oceanfish81/go/src/git.apache.org/thrift.git/lib/go/thrift (from $GOPATH)~/bender/thrift$ go get -u git.apache.org/thrift.git/lib/go/thrift
$ go build_/home/oceanfish81/bender/thrift
./thrift.go:35:25: error: not enough arguments
./thrift.go:55:38: error: not enough arguments
./thrift.go:60:16: error: argument 1 has incompatible type (missing method 'Deadline')
./thrift.go:60:10: error: not enough arguments
~/bender$ git pull
Already up to date.
I am using
$ go version
go version go1.15.2 gollvm LLVM 12.0.0git linux/amd64
.
Here is my environment:
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/oceanfish81/.cache/go-build"
GOENV="/home/oceanfish81/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/oceanfish81/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/oceanfish81/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/oceanfish81/gollvm_dist"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/oceanfish81/gollvm_dist/tools"
GCCGO="/home/oceanfish81/gollvm_dist/bin/llvm-goc"
AR="ar"
CC="/usr/bin/clang"
CXX="/usr/bin/clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build167274628=/tmp/go-build -gno-record-gcc-switches -funwind-tables"
Duration should be measured using monotonic clocks, this can be done by using standard time.Time
and time.Duration
instead of storing int64
unix epoch times. https://golang.org/pkg/time/#hdr-Monotonic_Clocks
Hello. 👋 Looking to try using bender for gRPC services. Are there any plans to add executors for gRPC any time soon?
I use thrift for go language to test High concurrency,but only support less than 1000 goroutines ,when bigger,it will report "getsockopt: connection timed out",how i can do to resolve it ? i found go thrift only support TSimpleServer,but other language support TSimpleServer,TThreadedServer,TThreadPoolServer,TNonBlockingServer
The API for bender was created before the API for jbender (see https://github.com/pinterest/jbender). The API for jbender is more elegant and requires a LOT less memory allocations in the main loop (as it sends far fewer events). This would be a non-backwards compatible change, but given the way people vendor dependencies that should be alright for existing users.
// UniformIntervalGenerator creates and IntervalGenerator that outputs 1/rate every time it is
// called. Boring, right?
func UniformIntervalGenerator(rate float64) IntervalGenerator {
irate := int64(rate / float64(time.Second))
return func(_ int64) int64 {
return irate
}
}
This implementation is buggy because if I pass in float64(time.Second)
for rate, then irate = 1
, and that value is passed into LoadTestThroughput
as a Duration value, which means the wait time will be 1 nanosecond. If I pass in 1.0
with the intention of 1.0 QPS, then the resulting wait time will be 0 nanoseconds.
Looks like irate
should be int64(float64(time.Second) / rate)
instead of the other way around. The comments suggests that this should be the case.
Changing to the proposed fix will also help create a consistent API with ExponentialIntervalGenerator
(i.e. passing in the QPS value).
This is a Golang playground that demonstrates my understanding. I substituted the math from the functions and used the same QPS rate for both.
https://play.golang.org/p/jKXTYHWSC2
I can make a pull request if this a legitimate bug.
golint ./...
bender.go:25:6: exported type IntervalGenerator should have comment or be unexported
bender.go:27:6: exported type RequestExecutor should have comment or be unexported
bender_test.go:27:56: don't use underscores in Go names; func parameter expected_msgs should be expectedMsgs
bender_test.go:29:3: don't use underscores in Go names; var actual_msg should be actualMsg
recorders.go:25:6: exported type Recorder should have comment or be unexported
recorders.go:27:1: exported function Record should have comment or be unexported
recorders.go:39:1: exported function NewLoggingRecorder should have comment or be unexported
recorders.go:45:1: exported function NewHistogramRecorder should have comment or be unexported
hist/hist.go:26:6: exported type Histogram should have comment or be unexported
hist/hist.go:37:1: exported function NewHistogram should have comment or be unexported
hist/hist.go:41:1: exported method Histogram.Start should have comment or be unexported
hist/hist.go:45:1: exported method Histogram.End should have comment or be unexported
hist/hist.go:49:1: exported method Histogram.Add should have comment or be unexported
hist/hist.go:62:1: exported method Histogram.AddError should have comment or be unexported
hist/hist.go:64:2: should replace h.errCnt += 1 with h.errCnt++
hist/hist.go:67:1: exported method Histogram.Percentiles should have comment or be unexported
hist/hist.go:76:2: don't use underscores in Go names; var p_idx should be pIdx
hist/hist.go:93:1: exported method Histogram.Average should have comment or be unexported
hist/hist.go:97:1: exported method Histogram.ErrorPercent should have comment or be unexported
http/http.go:26:6: exported type HttpBodyValidator should have comment or be unexported
http/http.go:26:6: type HttpBodyValidator should be HTTPBodyValidator
http/http.go:26:6: type name will be used as http.HttpBodyValidator by other packages, and that stutters; consider calling this BodyValidator
http/http.go:28:1: exported function CreateHttpExecutor should have comment or be unexported
http/http.go:28:6: func CreateHttpExecutor should be CreateHTTPExecutor
thrift/thrift.go:28:6: exported type ThriftClientExecutor should have comment or be unexported
thrift/thrift.go:28:6: type name will be used as thrift.ThriftClientExecutor by other packages, and that stutters; consider calling this ClientExecutor
thrift/thrift.go:30:1: exported function NewThriftRequestExec should have comment or be unexported
thrift/thrift.go:49:1: exported function DeserializeThriftMessage should have comment or be unexported
thrift/thrift.go:52:8: var typeId should be typeID
thrift/thrift.go:52:16: var seqId should be seqID
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.