From b86a9dbd22245f708a7c68d21723e33ed20fc96e Mon Sep 17 00:00:00 2001 From: Zuhayr Elahi Date: Thu, 21 Feb 2019 13:05:00 -0800 Subject: [PATCH] documentation: Adds package level comments (#2612) * ADDED package level comments for: benchmark/, examples/helloworld/ * UPDATED code to run gofmt * FIXED linter errors * FIXED spelling error * FIXED documentation based on feedback * FIXED comment to add pointer to another file * ADDED reference to start server * ADDED fix to include command to start server --- benchmark/client/main.go | 20 ++++++++++++++++++++ benchmark/server/main.go | 9 +++++++++ benchmark/stats/stats.go | 1 + examples/helloworld/greeter_client/main.go | 1 + examples/helloworld/greeter_server/main.go | 1 + 5 files changed, 32 insertions(+) diff --git a/benchmark/client/main.go b/benchmark/client/main.go index 1cb02ea1..76202439 100644 --- a/benchmark/client/main.go +++ b/benchmark/client/main.go @@ -16,6 +16,26 @@ * */ +/* +Package main provides a client used for benchmarking. Before running the +client, the user would need to launch the grpc server. + +To start the server before running the client, you can run look for the command +under the following file: + + benchmark/server/main.go + +After starting the server, the client can be run. An example of how to run this +command is: + +go run benchmark/client/main.go -test_name=grpc_test + +If the server is running on a different port than 50051, then use the port flag +for the client to hit the server on the correct port. +An example for how to run this command on a different port can be found here: + +go run benchmark/client/main.go -test_name=grpc_test -port=8080 +*/ package main import ( diff --git a/benchmark/server/main.go b/benchmark/server/main.go index fe190944..59987366 100644 --- a/benchmark/server/main.go +++ b/benchmark/server/main.go @@ -16,6 +16,15 @@ * */ +/* +Package main provides a server used for benchmarking. It launches a server +which is listening on port 50051. An example to start the server can be found +at: + go run benchmark/server/main.go -test_name=grpc_test + +After starting the server, the client can be run separately and used to test +qps and latency. +*/ package main import ( diff --git a/benchmark/stats/stats.go b/benchmark/stats/stats.go index 041d2475..20c96b86 100644 --- a/benchmark/stats/stats.go +++ b/benchmark/stats/stats.go @@ -16,6 +16,7 @@ * */ +// Package stats registers stats used for creating benchmarks package stats import ( diff --git a/examples/helloworld/greeter_client/main.go b/examples/helloworld/greeter_client/main.go index 8c44ef03..4330b9e5 100644 --- a/examples/helloworld/greeter_client/main.go +++ b/examples/helloworld/greeter_client/main.go @@ -16,6 +16,7 @@ * */ +// Package main implements a client for Greeter service. package main import ( diff --git a/examples/helloworld/greeter_server/main.go b/examples/helloworld/greeter_server/main.go index b339a610..e99fb26a 100644 --- a/examples/helloworld/greeter_server/main.go +++ b/examples/helloworld/greeter_server/main.go @@ -18,6 +18,7 @@ //go:generate protoc -I ../helloworld --go_out=plugins=grpc:../helloworld ../helloworld/helloworld.proto +// Package main implements a server for Greeter service. package main import (