Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Schultz, Lucian
lab-grpc
Commits
5cb0a823
Commit
5cb0a823
authored
Mar 01, 2021
by
Nane Kratzke
Browse files
Call exceptions
parent
0f5a29c3
Changes
1
Show whitespace changes
Inline
Side-by-side
grpc/greeter_monitor.py
View file @
5cb0a823
...
@@ -23,11 +23,17 @@ def monitor():
...
@@ -23,11 +23,17 @@ def monitor():
for
i
in
range
(
0
,
n
):
for
i
in
range
(
0
,
n
):
start
=
time
.
time
()
start
=
time
.
time
()
try
:
x
=
stub
.
SayHello
(
helloworld_pb2
.
HelloRequest
(
name
=
'you'
))
x
=
stub
.
SayHello
(
helloworld_pb2
.
HelloRequest
(
name
=
'you'
))
except
:
print
(
f
"Error gRPC call
{
grpc_svc
}
:
{
grpc_port
}
"
)
grpc_s
.
append
(
time
.
time
()
-
start
)
grpc_s
.
append
(
time
.
time
()
-
start
)
start
=
time
.
time
()
start
=
time
.
time
()
try
:
y
=
requests
.
get
(
f
"http://
{
rest_svc
}
:
{
rest_port
}
/hello/you"
)
y
=
requests
.
get
(
f
"http://
{
rest_svc
}
:
{
rest_port
}
/hello/you"
)
except
:
print
(
f
"Error GET http://
{
rest_svc
}
:
{
rest_port
}
/hello/you"
)
rest_s
.
append
(
time
.
time
()
-
start
)
rest_s
.
append
(
time
.
time
()
-
start
)
return
", "
.
join
([
return
", "
.
join
([
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment