19 #ifndef TEST_QPS_SERVER_H
20 #define TEST_QPS_SERVER_H
32 #include "src/proto/grpc/testing/control.pb.h"
33 #include "src/proto/grpc/testing/messages.pb.h"
55 ServerStats
Mark(
bool reset) {
62 timer_result =
timer->Mark();
65 timer_result =
timer_->Mark();
72 stats.set_time_elapsed(timer_result.
wall);
77 stats.set_cq_poll_count(poll_count);
89 if (
payload->body().length() !=
static_cast<size_t>(
size)) {
90 std::unique_ptr<char[]> body(
new char[
size]());
99 const ServerConfig&
config) {
100 if (
config.has_security_params()) {
102 if (
config.security_params().cred_type().empty()) {
125 if (
config.resource_quota_size() > 0) {
127 .Resize(
config.resource_quota_size()));
129 for (
const auto& channel_arg :
config.channel_args()) {
130 switch (channel_arg.value_case()) {
131 case ChannelArg::kStrValue:
132 builder->AddChannelArgument(channel_arg.name(),
133 channel_arg.str_value());
135 case ChannelArg::kIntValue:
136 builder->AddChannelArgument(channel_arg.name(),
137 channel_arg.int_value());
139 case ChannelArg::VALUE_NOT_SET:
141 channel_arg.name().c_str());