Comments (6)
That is a great idea. I've been working on a new version of bender that uses more idiomatic Go (and less memory). I have rewritten the core loop (and have been using it for a new project), but I haven't (yet) had time to rewrite the HTTP and Thrift tutorials to use it. You can take a look here: https://github.com/cgordon/bender.
As I get time this week, I'll try to add some other new things, including a simple JSON output format for the timing events and some Python tools to generate useful statistics from that output.
from bender.
@cgordon since you've been working on a new version could you consider allowing user to provide their own time measure checkpoints (optional)?
Setup before sending a request might take a long time and interfere the results. I've encountered that while doing simple UDP loadtests (I've stripped not important parts):
func UDPExecutor(_ int64, request interface{}) (interface{}, error) {
datagram := request.(*Datagram)
// This part can take quite long and we'd like to ignore it in time measures
conn, err := net.Dial("udp", addr)
if err != nil {
return nil, err
}
defer conn.Close()
// Start measure here
conn.SetWriteDeadline(time.Now().Add(timeout))
_, err = conn.Write(datagram.Data)
if err != nil {
return nil, err
}
buffer := make([]byte, bufferSize)
conn.SetReadDeadline(time.Now().Add(timeout))
n, err := conn.Read(buffer)
if err != nil {
return nil, err
}
return buffer[:n], nil
}
My "temporary fix" was to calculate it manually and return the results as a struct
// Response represents a udp response received
type Response struct {
Start time.Time
End time.Time
Elapsed time.Duration
Data []byte
}
But it also means that histogram and other recorders need to be adjusted for this new format. It would be really good to have a generic solution to this.
from bender.
@earlgreyz That's an interesting idea. I've been having the request generator do all the initialization for our load testing, and passing everything into the executor, but I can see how you may want to avoid that here. It looks like the easiest option to make this work would be to redefine the RequestExecutor to return four values: the response, the start time, the end time and an error. Then, rather than the main loop tracking the start and end time, the request executor would need to do so. In that case, it would also be easy to write a little wrapper function that did the timing (for people who don't need that fine control). Does that sound like it would do what you want?
from bender.
@cgordon yes, that seems like a good solution
from bender.
I can prepare a PR if it is agreed on, but it will most likely break the backwards compatibility.
from bender.
I think that would be a good improvement. Any opinion, @cgordon?
from bender.
Related Issues (11)
- multiple-value tFac.GetTransport() in single-value context when building against code generated by latest thrift (808d143245f)
- UniformIntervalGenerator implementation is Buggy HOT 2
- Update the bender API to look more like jbender HOT 2
- Revisit the performance notes in the README
- how to use thrift support High concurrency? HOT 2
- golint reporting errors HOT 2
- gRPC Support HOT 1
- not enough arguments in thrift/thrift.go HOT 2
- Issues with running go install HOT 15
- ../client/main.go:23: cannot use "hello,world!" (type string) as type *string in assignment HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bender.