From 480e524adc7838d26d5e82fa8b9884f312a76d1e Mon Sep 17 00:00:00 2001 From: Oleg Bespalov Date: Mon, 25 Sep 2023 15:40:18 +0200 Subject: [PATCH] Document gRPC's -bin metadata --- .../07 k6-experimental/02 grpc/20-Params.md | 7 +++++-- .../docs/02 javascript api/11 k6-net-grpc/20-Params.md | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/data/markdown/docs/02 javascript api/07 k6-experimental/02 grpc/20-Params.md b/src/data/markdown/docs/02 javascript api/07 k6-experimental/02 grpc/20-Params.md index 4ebe15f908..6786e7e4b9 100644 --- a/src/data/markdown/docs/02 javascript api/07 k6-experimental/02 grpc/20-Params.md +++ b/src/data/markdown/docs/02 javascript api/07 k6-experimental/02 grpc/20-Params.md @@ -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"`).
The type can also be a number, in which case k6 interprets it as milliseconds, e.g., `60000` is equivalent to `"60s"`. | @@ -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); diff --git a/src/data/markdown/docs/02 javascript api/11 k6-net-grpc/20-Params.md b/src/data/markdown/docs/02 javascript api/11 k6-net-grpc/20-Params.md index 2cdde3b15a..3ca65bfe14 100644 --- a/src/data/markdown/docs/02 javascript api/11 k6-net-grpc/20-Params.md +++ b/src/data/markdown/docs/02 javascript api/11 k6-net-grpc/20-Params.md @@ -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"`).
The type can also be a number, in which case k6 interprets it as milliseconds, e.g., `60000` is equivalent to `"60s"`. | @@ -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);