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
59567427
Commit
59567427
authored
9 years ago
by
Vijay Pai
Browse files
Options
Downloads
Patches
Plain Diff
Copyright and clang-format
parent
8166e304
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/proto/grpc/testing/services.proto
+1
-1
1 addition, 1 deletion
src/proto/grpc/testing/services.proto
test/cpp/qps/driver.cc
+14
-14
14 additions, 14 deletions
test/cpp/qps/driver.cc
test/cpp/qps/qps_worker.cc
+1
-1
1 addition, 1 deletion
test/cpp/qps/qps_worker.cc
with
16 additions
and
16 deletions
src/proto/grpc/testing/services.proto
+
1
−
1
View file @
59567427
// Copyright 2015, Google Inc.
// Copyright 2015
-2016
, Google Inc.
// All rights reserved.
// All rights reserved.
//
//
// Redistribution and use in source and binary forms, with or without
// Redistribution and use in source and binary forms, with or without
...
...
This diff is collapsed.
Click to expand it.
test/cpp/qps/driver.cc
+
14
−
14
View file @
59567427
...
@@ -60,9 +60,9 @@ using std::vector;
...
@@ -60,9 +60,9 @@ using std::vector;
namespace
grpc
{
namespace
grpc
{
namespace
testing
{
namespace
testing
{
static
std
::
string
get_host
(
const
std
::
string
&
worker
)
{
static
std
::
string
get_host
(
const
std
::
string
&
worker
)
{
char
*
host
;
char
*
host
;
char
*
port
;
char
*
port
;
gpr_split_host_port
(
worker
.
c_str
(),
&
host
,
&
port
);
gpr_split_host_port
(
worker
.
c_str
(),
&
host
,
&
port
);
string
s
(
host
);
string
s
(
host
);
...
@@ -72,9 +72,9 @@ static std::string get_host(const std::string &worker) {
...
@@ -72,9 +72,9 @@ static std::string get_host(const std::string &worker) {
return
s
;
return
s
;
}
}
static
std
::
unordered_map
<
string
,
std
::
deque
<
int
>>
static
std
::
unordered_map
<
string
,
std
::
deque
<
int
>>
get_hosts_and_cores
(
get_hosts_and_cores
(
const
deque
<
string
>&
workers
)
{
const
deque
<
string
>&
workers
)
{
std
::
unordered_map
<
string
,
std
::
deque
<
int
>>
hosts
;
std
::
unordered_map
<
string
,
std
::
deque
<
int
>>
hosts
;
for
(
auto
it
=
workers
.
begin
();
it
!=
workers
.
end
();
it
++
)
{
for
(
auto
it
=
workers
.
begin
();
it
!=
workers
.
end
();
it
++
)
{
string
host
=
get_host
(
*
it
);
string
host
=
get_host
(
*
it
);
if
(
hosts
.
find
(
host
)
==
hosts
.
end
())
{
if
(
hosts
.
find
(
host
)
==
hosts
.
end
())
{
...
@@ -86,7 +86,7 @@ static std::unordered_map<string,std::deque<int>>
...
@@ -86,7 +86,7 @@ static std::unordered_map<string,std::deque<int>>
grpc
::
Status
s
=
stub
->
CoreCount
(
&
ctx
,
dummy
,
&
cores
);
grpc
::
Status
s
=
stub
->
CoreCount
(
&
ctx
,
dummy
,
&
cores
);
assert
(
s
.
ok
());
assert
(
s
.
ok
());
std
::
deque
<
int
>
dq
;
std
::
deque
<
int
>
dq
;
for
(
int
i
=
0
;
i
<
cores
.
cores
();
i
++
)
{
for
(
int
i
=
0
;
i
<
cores
.
cores
();
i
++
)
{
dq
.
push_back
(
i
);
dq
.
push_back
(
i
);
}
}
hosts
[
host
]
=
dq
;
hosts
[
host
]
=
dq
;
...
@@ -141,8 +141,8 @@ struct ClientData {
...
@@ -141,8 +141,8 @@ struct ClientData {
std
::
unique_ptr
<
ScenarioResult
>
RunScenario
(
std
::
unique_ptr
<
ScenarioResult
>
RunScenario
(
const
ClientConfig
&
initial_client_config
,
size_t
num_clients
,
const
ClientConfig
&
initial_client_config
,
size_t
num_clients
,
const
ServerConfig
&
initial_server_config
,
size_t
num_servers
,
int
warmup_seconds
,
const
ServerConfig
&
initial_server_config
,
size_t
num_servers
,
int
benchmark_seconds
,
int
spawn_local_worker_count
)
{
int
warmup_seconds
,
int
benchmark_seconds
,
int
spawn_local_worker_count
)
{
// ClientContext allocations (all are destroyed at scope exit)
// ClientContext allocations (all are destroyed at scope exit)
list
<
ClientContext
>
contexts
;
list
<
ClientContext
>
contexts
;
...
@@ -228,7 +228,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
...
@@ -228,7 +228,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
bool
match
=
false
;
bool
match
=
false
;
int
limit
=
dq
.
size
();
int
limit
=
dq
.
size
();
for
(
size_t
cli
=
0
;
cli
<
num_clients
;
cli
++
)
{
for
(
size_t
cli
=
0
;
cli
<
num_clients
;
cli
++
)
{
if
(
host_str
==
get_host
(
workers
[
cli
+
num_servers
]))
{
if
(
host_str
==
get_host
(
workers
[
cli
+
num_servers
]))
{
limit
-=
client_core_limit
;
limit
-=
client_core_limit
;
match
=
true
;
match
=
true
;
}
}
...
@@ -241,7 +241,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
...
@@ -241,7 +241,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
if
(
server_core_limit
>
0
)
{
if
(
server_core_limit
>
0
)
{
auto
&
dq
=
hosts_cores
[
host_str
];
auto
&
dq
=
hosts_cores
[
host_str
];
GPR_ASSERT
(
dq
.
size
()
>=
static_cast
<
size_t
>
(
server_core_limit
));
GPR_ASSERT
(
dq
.
size
()
>=
static_cast
<
size_t
>
(
server_core_limit
));
for
(
int
core
=
0
;
core
<
server_core_limit
;
core
++
)
{
for
(
int
core
=
0
;
core
<
server_core_limit
;
core
++
)
{
server_config
.
add_core_list
(
dq
.
front
());
server_config
.
add_core_list
(
dq
.
front
());
dq
.
pop_front
();
dq
.
pop_front
();
}
}
...
@@ -270,8 +270,8 @@ std::unique_ptr<ScenarioResult> RunScenario(
...
@@ -270,8 +270,8 @@ std::unique_ptr<ScenarioResult> RunScenario(
auto
*
clients
=
new
ClientData
[
num_clients
];
auto
*
clients
=
new
ClientData
[
num_clients
];
for
(
size_t
i
=
0
;
i
<
num_clients
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<
num_clients
;
i
++
)
{
const
auto
&
worker
=
workers
[
i
+
num_servers
];
const
auto
&
worker
=
workers
[
i
+
num_servers
];
gpr_log
(
GPR_INFO
,
"Starting client on %s (worker #%d)"
,
gpr_log
(
GPR_INFO
,
"Starting client on %s (worker #%d)"
,
worker
.
c_str
(),
worker
.
c_str
(),
i
+
num_servers
);
i
+
num_servers
);
clients
[
i
].
stub
=
WorkerService
::
NewStub
(
clients
[
i
].
stub
=
WorkerService
::
NewStub
(
CreateChannel
(
worker
,
InsecureChannelCredentials
()));
CreateChannel
(
worker
,
InsecureChannelCredentials
()));
ClientConfig
per_client_config
=
client_config
;
ClientConfig
per_client_config
=
client_config
;
...
@@ -296,7 +296,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
...
@@ -296,7 +296,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
}
}
if
(
client_core_limit
>
0
)
{
if
(
client_core_limit
>
0
)
{
GPR_ASSERT
(
dq
.
size
()
>=
static_cast
<
size_t
>
(
client_core_limit
));
GPR_ASSERT
(
dq
.
size
()
>=
static_cast
<
size_t
>
(
client_core_limit
));
for
(
int
core
=
0
;
core
<
client_core_limit
;
core
++
)
{
for
(
int
core
=
0
;
core
<
client_core_limit
;
core
++
)
{
per_client_config
.
add_core_list
(
dq
.
front
());
per_client_config
.
add_core_list
(
dq
.
front
());
dq
.
pop_front
();
dq
.
pop_front
();
}
}
...
...
This diff is collapsed.
Click to expand it.
test/cpp/qps/qps_worker.cc
+
1
−
1
View file @
59567427
...
@@ -134,7 +134,7 @@ class WorkerServiceImpl GRPC_FINAL : public WorkerService::Service {
...
@@ -134,7 +134,7 @@ class WorkerServiceImpl GRPC_FINAL : public WorkerService::Service {
return
ret
;
return
ret
;
}
}
Status
CoreCount
(
ServerContext
*
ctx
,
const
CoreRequest
*
,
Status
CoreCount
(
ServerContext
*
ctx
,
const
CoreRequest
*
,
CoreResponse
*
resp
)
GRPC_OVERRIDE
{
CoreResponse
*
resp
)
GRPC_OVERRIDE
{
resp
->
set_cores
(
gpr_cpu_num_cores
());
resp
->
set_cores
(
gpr_cpu_num_cores
());
return
Status
::
OK
;
return
Status
::
OK
;
...
...
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