Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions examples/MULTIPLE_ENDPOINTS.md
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.

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor

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


## Define a traffic profile

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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 traffic-profile.yaml in your current working directory. This will act as your configuration for the file-based request source.


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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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
```