Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
3d1fe58f
Commit
3d1fe58f
authored
8 years ago
by
Mark D. Roth
Browse files
Options
Downloads
Patches
Plain Diff
Code review changes.
parent
859cce41
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/core/end2end/tests/filter_latency.c
+7
-6
7 additions, 6 deletions
test/core/end2end/tests/filter_latency.c
with
7 additions
and
6 deletions
test/core/end2end/tests/filter_latency.c
+
7
−
6
View file @
3d1fe58f
...
...
@@ -106,8 +106,7 @@ static void end_test(grpc_end2end_test_fixture *f) {
grpc_completion_queue_destroy
(
f
->
cq
);
}
// Simple request via a server filter that always fails to initialize
// the call.
// Simple request via a server filter that saves the reported latency value.
static
void
test_request
(
grpc_end2end_test_config
config
)
{
grpc_call
*
c
;
grpc_call
*
s
;
...
...
@@ -220,8 +219,8 @@ static void test_request(grpc_end2end_test_config config) {
grpc_metadata_array_destroy
(
&
request_metadata_recv
);
grpc_call_details_destroy
(
&
call_details
);
grpc_call_destroy
(
c
);
grpc_call_destroy
(
s
);
grpc_call_destroy
(
c
);
const
gpr_timespec
end_time
=
gpr_now
(
GPR_CLOCK_MONOTONIC
);
const
gpr_timespec
max_latency
=
gpr_time_sub
(
end_time
,
start_time
);
...
...
@@ -230,6 +229,8 @@ static void test_request(grpc_end2end_test_config config) {
GPR_ASSERT
(
gpr_time_cmp
(
gpr_time_0
(
GPR_TIMESPAN
),
g_client_latency
)
<
0
);
GPR_ASSERT
(
gpr_time_cmp
(
max_latency
,
g_server_latency
)
>=
0
);
GPR_ASSERT
(
gpr_time_cmp
(
gpr_time_0
(
GPR_TIMESPAN
),
g_server_latency
)
<
0
);
// Server latency should always be smaller than client latency.
GPR_ASSERT
(
gpr_time_cmp
(
g_server_latency
,
g_client_latency
)
<
0
);
cq_verifier_destroy
(
cqv
);
...
...
@@ -241,7 +242,7 @@ static void test_request(grpc_end2end_test_config config) {
}
/*******************************************************************************
* Test filter
* Test
latency
filter
*/
static
grpc_error
*
init_call_elem
(
grpc_exec_ctx
*
exec_ctx
,
...
...
@@ -282,7 +283,7 @@ static const grpc_channel_filter test_client_filter = {
init_channel_elem
,
destroy_channel_elem
,
grpc_call_next_get_peer
,
"filter_latency"
};
"
client_
filter_latency"
};
static
const
grpc_channel_filter
test_server_filter
=
{
grpc_call_next_op
,
...
...
@@ -295,7 +296,7 @@ static const grpc_channel_filter test_server_filter = {
init_channel_elem
,
destroy_channel_elem
,
grpc_call_next_get_peer
,
"filter_latency"
};
"
server_
filter_latency"
};
/*******************************************************************************
* Registration
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment