allow using state in the request function#4
Open
haski wants to merge 10 commits intoAppsFlyer:masterfrom
Open
Conversation
added 8 commits
June 21, 2020 22:12
…state to be used.
…func # Conflicts: # go.sum # wrk3.go
refactor tests to increase coverage
eranharel
reviewed
Jun 28, 2020
| ) | ||
|
|
||
| type RequestFunc func() error | ||
| type RequestHandler interface { |
Contributor
There was a problem hiding this comment.
No docs for exported types
wrk3.go
Outdated
| return reqFunc(localIndex) | ||
| } | ||
|
|
||
| var flagsDefined = false |
Contributor
There was a problem hiding this comment.
These shouldn't be global, and I think it was already handled in the command parsing. What happened here?
| if ok { | ||
| res.counter++ | ||
| err := e.benchmark.SendRequest() | ||
| err := e.benchmark.SendRequest.ExecuteRequest(res.counter) |
Contributor
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
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.
added 2 commits
June 28, 2020 17:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
move from parameterless function to an interface with a single method receiving an index to allow using a state when sending a request.