aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps/server.h
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2016-02-01 09:33:11 -0800
committerGravatar Vijay Pai <vpai@google.com>2016-02-01 09:33:11 -0800
commitc64736d852991c734938a16d58cb5861b7014c07 (patch)
tree1b0ea4a17540426fc2355aabba5c85f1492c5de4 /test/cpp/qps/server.h
parent03ba4d746a34855c2d6498f23b06f8a0ae6592eb (diff)
Clean-up core list usage and make it possible to reset the core list
Diffstat (limited to 'test/cpp/qps/server.h')
-rw-r--r--test/cpp/qps/server.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/test/cpp/qps/server.h b/test/cpp/qps/server.h
index bc6f9f99e3..94a6f8acfa 100644
--- a/test/cpp/qps/server.h
+++ b/test/cpp/qps/server.h
@@ -51,18 +51,10 @@ namespace testing {
class Server {
public:
explicit Server(const ServerConfig& config) : timer_(new Timer) {
- int clsize = config.core_list_size();
- if (clsize > 0) {
- std::vector<int> core_list;
- for (int i = 0; i < clsize; i++) {
- core_list.push_back(config.core_list(i));
- }
- cores_ = LimitCores(core_list);
- } else {
- cores_ = gpr_cpu_num_cores();
- }
+ cores_ = LimitCores(config.core_list().data(), config.core_list_size());
if (config.port()) {
port_ = config.port();
+
} else {
port_ = grpc_pick_unused_port_or_die();
}