-
Notifications
You must be signed in to change notification settings - Fork 4
allow using state in the request function #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…state to be used.
…func # Conflicts: # go.sum # wrk3.go
refactor tests to increase coverage
| ) | ||
|
|
||
| type RequestFunc func() error | ||
| type RequestHandler interface { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No docs for exported types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
wrk3.go
Outdated
| return reqFunc(localIndex) | ||
| } | ||
|
|
||
| var flagsDefined = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These shouldn't be global, and I think it was already handled in the command parsing. What happened here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
| if ok { | ||
| res.counter++ | ||
| err := e.benchmark.SendRequest() | ||
| err := e.benchmark.SendRequest.ExecuteRequest(res.counter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically this means all go routines cycle through the same clients at roughly the same times (and if the index is used for requests, for that as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
roughly is not the same and in any way so what ? the whole point here is to allow concurrent requests to the server.
the index is just an indication of progress, not even a global one and the way that I use it in the test allow me to distribute over the connections. in my book it is good enough.
move from parameterless function to an interface with a single method receiving an index to allow using a state when sending a request.