MCPcopy Create free account
hub / github.com/apache/brpc / incr_thread

Function incr_thread

test/brpc_redis_unittest.cpp:1135–1148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1133}
1134
1135void* incr_thread(void* arg) {
1136 brpc::Channel* c = static_cast<brpc::Channel*>(arg);
1137 for (int i = 0; i < 5000; ++i) {
1138 brpc::RedisRequest request;
1139 brpc::RedisResponse response;
1140 brpc::Controller cntl;
1141 EXPECT_TRUE(request.AddCommand("incr count"));
1142 c->CallMethod(NULL, &cntl, &request, &response, NULL);
1143 EXPECT_FALSE(cntl.Failed()) << cntl.ErrorText();
1144 EXPECT_EQ(1, response.reply_size());
1145 EXPECT_TRUE(response.reply(0).is_integer()) << response.reply(0);
1146 }
1147 return NULL;
1148}
1149
1150TEST_F(RedisTest, server_concurrency) {
1151 std::string password = GeneratePassword();

Callers

nothing calls this directly

Calls 6

ErrorTextMethod · 0.80
reply_sizeMethod · 0.80
is_integerMethod · 0.80
AddCommandMethod · 0.45
CallMethodMethod · 0.45
FailedMethod · 0.45

Tested by

no test coverage detected