Skip to content
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

Document gRPC's -bin metadata #1341

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ excerpt: 'Params is an object used by the gRPC methods that generate RPC request

| Name | Type | Description |
|------|------|-------------|
| `Params.metadata` | object | Object with key-value pairs representing custom metadata the user would like to add to the request. |
| `Params.metadata` | object | Object with key-value pairs representing custom metadata the user would like to add to the request. Values of [keys ending with `-bin`](https://grpc.io/docs/what-is-grpc/core-concepts/#metadata) will be treated as binary data. |
| `Params.tags` | object | Key-value pairs where the keys are names of tags and the values are tag values. Response time metrics generated as a result of the request will have these tags added to them, allowing the user to filter out those results specifically, when looking at results data. |
| `Params.timeout` | string / number | Request timeout to use. Default timeout is 60 seconds (`"60s"`). <br/> The type can also be a number, in which case k6 interprets it as milliseconds, e.g., `60000` is equivalent to `"60s"`. |

Expand All @@ -29,7 +29,10 @@ export default function () {
longitude: -747127767,
};
const params = {
metadata: { 'x-my-header': 'k6test' },
metadata: {
'x-my-header': 'k6test',
'x-my-header-bin': new Uint8Array([1, 2, 3]),
},
tags: { k6test: 'yes' },
};
const response = client.invoke('main.RouteGuide/GetFeature', req, params);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ excerpt: 'Params is an object used by the gRPC methods that generate RPC request

| Name | Type | Description |
|------|------|-------------|
| `Params.metadata` | object | Object with key-value pairs representing custom metadata the user would like to add to the request. |
| `Params.metadata` | object | Object with key-value pairs representing custom metadata the user would like to add to the request. Values of [keys ending with `-bin`](https://grpc.io/docs/what-is-grpc/core-concepts/#metadata) will be treated as binary data. |
| `Params.tags` | object | Key-value pairs where the keys are names of tags and the values are tag values. Response time metrics generated as a result of the request will have these tags added to them, allowing the user to filter out those results specifically, when looking at results data. |
| `Params.timeout` | string / number | Request timeout to use. Default timeout is 60 seconds (`"60s"`). <br/> The type can also be a number, in which case k6 interprets it as milliseconds, e.g., `60000` is equivalent to `"60s"`. |

Expand All @@ -29,7 +29,10 @@ export default function () {
longitude: -747127767,
};
const params = {
metadata: { 'x-my-header': 'k6test' },
metadata: {
'x-my-header': 'k6test',
'x-my-header-bin': new Uint8Array([1, 2, 3]),
},
tags: { k6test: 'yes' },
};
const response = client.invoke('main.RouteGuide/GetFeature', req, params);
Expand Down
Loading