-
Notifications
You must be signed in to change notification settings - Fork 94
Examples: a place to stash practical use cases #637
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # Hitting multiple endpoints with a traffic profile | ||
|
|
||
| ## Description | ||
|
|
||
| Below is an example which will send requests to two endpoints `127.0.0.1:80` and `127.0.0.2:80`, while alternating over two request headers, which contain different paths and hosts. | ||
|
|
||
| ## Define a traffic profile | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unless I'm mistaken you've created this term traffic profile here, and it is not used elsewhere. The way you've structured this makes it look like traffic profile is a broader nighthawk term in a way that I think is misleading. Could we instead discuss it like: Place a file called |
||
|
|
||
| Place a file called `traffic-profile.yaml` in your current working directory. | ||
|
|
||
| ```yaml | ||
| options: | ||
| - request_method: 1 | ||
| request_headers: | ||
| - { header: { key: ":path", value: "/foo" } } | ||
| - { header: { key: ":authority", value: "foo.com" } } | ||
| - request_method: 1 | ||
| request_headers: | ||
| - { header: { key: ":path", value: "/bar" } } | ||
| - { header: { key: ":authority", value: "bar.com" } } | ||
| ``` | ||
|
|
||
| ## Configuring the CLI | ||
|
|
||
| Below is a CLI examples which will consume the traffic profile created above, and send it to multiple endpoints. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. example - shouldn't be plural here |
||
|
|
||
| ```bash | ||
| bazel-bin/nighthawk_client --request-source-plugin-config "{name:\"nighthawk.file-based-request-source-plugin\",typed_config:{\"@type\":\"type.googleapis.com/nighthawk.request_source.FileBasedOptionsListRequestSourceConfig\",file_path:\"traffic-profile.yaml\",}}" -v trace --multi-target-endpoint 127.0.0.1:80 --multi-target-endpoint 127.0.0.2:80 --multi-target-path / --duration 1 | ||
| ``` | ||
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.
I recommend making explicit references to what features are being illustrated here. Examples of features being illustrated: multi-target, request source, etc.
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.
actually, importantly this isn't using request source generally, it's using the file based request source specifically