make http runner available as library, take 2#520
Conversation
|
@douglas-reid this version should be easier to review (even though github is not smart enough to notice the origin of the new file and show diffs...) |
|
this is the view that has the most readable diff |
douglas-reid
left a comment
There was a problem hiding this comment.
Looks pretty good. Just a few late-night naming questions, mainly centered around matching some of the conventions with http.Transport.
devel/fortio/httprunner.go
Outdated
| } | ||
|
|
||
| // HTTPRunner runs an http test and returns the aggregated stats. | ||
| func HTTPRunner(o *HTTPRunnerOptions) (*HTTPRunnerResults, error) { |
There was a problem hiding this comment.
Since this actually causes the Runner to Run, should we call this something like RunHTTP or RunHTTPTest?
devel/fortio/httprunner.go
Outdated
| type HTTPRunnerOptions struct { | ||
| RunnerOptions | ||
| URL string | ||
| Compression bool // defaults to no compression, only used by std client |
There was a problem hiding this comment.
Any reason to default to no compression? Could this be DisableCompression ?
There was a problem hiding this comment.
yes to lower cpu (even though it doesn't really apply when there is no payload)
devel/fortio/httprunner.go
Outdated
| RunnerOptions | ||
| URL string | ||
| Compression bool // defaults to no compression, only used by std client | ||
| StdClient bool // defaults to fast client |
There was a problem hiding this comment.
maybe DisableFastClient ?
devel/fortio/httprunner.go
Outdated
| Compression bool // defaults to no compression, only used by std client | ||
| StdClient bool // defaults to fast client | ||
| HTTP10 bool // defaults to http1.1 | ||
| NoKeepAlive bool // so default is keep alive |
devel/fortio/httprunner.go
Outdated
| URL string | ||
| Compression bool // defaults to no compression, only used by std client | ||
| StdClient bool // defaults to fast client | ||
| HTTP10 bool // defaults to http1.1 |
There was a problem hiding this comment.
I might be tempted to use an enum here (in the future, you may want to add an http/2 client).
There was a problem hiding this comment.
will see then, not sure how I'll add grpc yet
|
|
||
| // TestHTTP http request fetching. Main call being run at the target QPS. | ||
| // To be set as the Function in RunnerOptions. | ||
| func TestHTTP(t int) { |
There was a problem hiding this comment.
Maybe HTTPGet (or HTTPFetch)?
|
|
||
| package fortio | ||
|
|
||
| import ( |
There was a problem hiding this comment.
do we need a httprunner_test.go for this new library-ification?
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ldemailly Associated issue: 517 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Added test, moved echosrv code to lib, created DynamicHTTP for test, renames per @douglas-reid code review comments
|
Jenkins job istio/presubmit passed |
1 similar comment
|
Jenkins job istio/presubmit passed |
|
Jenkins job istio/presubmit passed |
|
@ldemailly: The following test failed, say
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
Jenkins passed and I had talked to Doug (and also got confused by the "approved" label) so I pushed. |
* make http runner available as library Moved a lot of the code from fortio main to the library so #517 can be better/easier (This is same as #519 with attempt at preserving history and without the grpc wip) * Added test, moved echosrv code to lib, ... Added test, moved echosrv code to lib, created DynamicHTTP for test, renames per @douglas-reid code review comments * Better initialization syntax * Add a negative testing Former-commit-id: 7b83910
* make http runner available as library Moved a lot of the code from fortio main to the library so istio#517 can be better/easier (This is same as istio#519 with attempt at preserving history and without the grpc wip) * Added test, moved echosrv code to lib, ... Added test, moved echosrv code to lib, created DynamicHTTP for test, renames per @douglas-reid code review comments * Better initialization syntax * Add a negative testing Former-commit-id: 7b83910
* make http runner available as library Moved a lot of the code from fortio main to the library so #517 can be better/easier (This is same as #519 with attempt at preserving history and without the grpc wip) * Added test, moved echosrv code to lib, ... Added test, moved echosrv code to lib, created DynamicHTTP for test, renames per @douglas-reid code review comments * Better initialization syntax * Add a negative testing Former-commit-id: 7b83910
* Add integration tests. * add fault_inject_test * format * Update comment. * fix format.
Co-authored-by: maistra-bot <null>
Co-authored-by: openshift-service-mesh-bot <null>
Moved a lot of the code from fortio main to the library so #517 can be
better/easier
(This is same as #519 with attempt at preserving history and without
the grpc wip)