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

gRPC Client Server #18

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 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
6 changes: 6 additions & 0 deletions grpc-client-server/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
start_prom:
docker build -t prometheus -f prometheus.Dockerfile .
docker run --rm\
--name prometheus \
-p 9090:9090 \
prometheus
41 changes: 34 additions & 7 deletions grpc-client-server/go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,40 @@
module github.com/CodeYourFuture/immersive-go-course/grpc-client-server
module github.com/Berkeli/immersive-go/grpc-client-server

go 1.19

require (
github.com/prometheus/client_golang v1.13.0
github.com/schollz/progressbar/v3 v3.11.0
google.golang.org/grpc v1.50.1
google.golang.org/protobuf v1.28.1
)

require (
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-openapi/errors v0.20.2 // indirect
github.com/go-openapi/strfmt v0.21.3 // indirect
github.com/golang/protobuf v1.5.2 // indirect
golang.org/x/net v0.0.0-20201021035429-f5854403a974 // indirect
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 // indirect
golang.org/x/text v0.3.3 // indirect
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect
google.golang.org/grpc v1.50.1 // indirect
google.golang.org/protobuf v1.27.1 // indirect
github.com/jedib0t/go-pretty v4.3.0+incompatible // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/mitchellh/mapstructure v1.3.3 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/rivo/uniseg v0.4.2 // indirect
github.com/stretchr/testify v1.8.1 // indirect
go.mongodb.org/mongo-driver v1.10.0 // indirect
golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect
golang.org/x/sys v0.1.0 // indirect
golang.org/x/term v0.1.0 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
483 changes: 474 additions & 9 deletions grpc-client-server/go.sum

Large diffs are not rendered by default.

261 changes: 261 additions & 0 deletions grpc-client-server/prober/prober.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions grpc-client-server/prober/prober.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
syntax = "proto3";

option go_package = "github.com/CodeYourFuture/immersive-go-course/grpc-client-server/prober";
option go_package = "github.com/Berkeli/immersive-go/grpc-client-server/prober";

import "google/protobuf/duration.proto";

package prober;

Expand All @@ -12,10 +14,14 @@ service Prober {
// The request message
message ProbeRequest {
string endpoint = 1;
int32 numberOfRequests = 2;
}

// The response message containing the result
// returns the average response time
message ProbeReply {
float result = 1;
google.protobuf.Duration ttfbAverageResponseTime = 1;
google.protobuf.Duration ttlbAverageResponseTime = 2;
int32 failedRequests = 3;
}

Loading