From bc07136ba5179cde54518e2a5f8494cffe33ae52 Mon Sep 17 00:00:00 2001 From: Bojan Date: Mon, 20 Apr 2020 22:23:16 -0300 Subject: [PATCH] toc for examples in docs --- www/docs/examples.md | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/www/docs/examples.md b/www/docs/examples.md index d2b92244..13237725 100644 --- a/www/docs/examples.md +++ b/www/docs/examples.md @@ -3,8 +3,21 @@ id: examples title: Examples --- - - +- [A simple insecure unary call](#simple-unary) +- [Server reflection](#server-reflection) +- [Metadata using template variables](#metadata-template) +- [Binary data](#binary-data) +- [Variable data for unary calls](#variable-data) +- [Custom parameters](#custom-parameters) +- [Protoset](#protoset) +- [Config file](#config) +- [Debug logging](#debug) +- [Client streaming](#client-stream) +- [Server streaming](#server-stream) +- [Well Known Types](#wkt) + + + ### A simple insecure unary call: ```sh @@ -15,6 +28,7 @@ ghz --insecure \ 0.0.0.0:50051 ``` + ### Server reflection Or same test using [server reflection](https://github.com/grpc/grpc/blob/master/doc/server-reflection.md) (just omit `-proto` option): @@ -26,6 +40,7 @@ ghz --insecure \ 0.0.0.0:50051 ``` + ### Metadata using template variables A simple unary call with metadata using template actions: @@ -39,6 +54,7 @@ ghz --insecure \ 0.0.0.0:50051 ``` + ### Binary data Using binary data file (see [writing a message](https://developers.google.com/protocol-buffers/docs/gotutorial#writing-a-message)): @@ -58,6 +74,7 @@ ghz --proto ./greeter.proto \ 0.0.0.0:50051 < ./hello_request_data.bin ``` + ### Variable data for unary calls Round-robin of messages for unary call: @@ -70,6 +87,7 @@ ghz --insecure \ 0.0.0.0:50051 ``` + ### Custom parameters Custom number of requests and concurrency: @@ -106,6 +124,7 @@ ghz --proto ./greeter.proto \ 0.0.0.0:50051 ``` + ### Protoset If a single object is given for data it is sent as every message. @@ -136,6 +155,7 @@ Alternatively `ghz` can be used with [Prototool](https://github.com/uber/prototo ghz --protoset $(prototool descriptor-set --include-imports --tmp) ... ``` + ### Config file Finally we can specify all settings, including the target host, conveniently in a JSON or TOML config file. @@ -150,6 +170,7 @@ Config file settings can be combined with command line arguments. CLI options ov ghz --config ./config.json -c 20 -n 1000 ``` + ### Debug logging With debug logging enabled: @@ -163,6 +184,7 @@ ghz --insecure \ 0.0.0.0:50051 ``` + ### Client streaming Client streaming with metadata: @@ -176,6 +198,7 @@ ghz --insecure \ 0.0.0.0:50051 ``` + ### Server streaming Server streaming with metadata: @@ -189,6 +212,7 @@ ghz --insecure \ 0.0.0.0:50051 ``` + ### Well Known Types [Well known types](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf) can be used: