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

Method LoadCaseSet

example/auto_concurrency_limiter/server.cpp:247–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245
246private:
247 void LoadCaseSet(const std::string& file_path) {
248 std::ifstream ifs(file_path.c_str(), std::ios::in);
249 if (!ifs) {
250 LOG(FATAL) << "Fail to open case set file: " << file_path;
251 }
252 std::string case_set_json((std::istreambuf_iterator<char>(ifs)),
253 std::istreambuf_iterator<char>());
254 test::TestCaseSet case_set;
255 std::string err;
256 if (!json2pb::JsonToProtoMessage(case_set_json, &case_set, &err)) {
257 LOG(FATAL)
258 << "Fail to trans case_set from json to protobuf message: "
259 << err;
260 }
261 _case_set = case_set;
262 ifs.close();
263 }
264
265 brpc::Server _server;
266 EchoServiceImpl* _echo_service;

Callers

nothing calls this directly

Calls 3

closeMethod · 0.80
JsonToProtoMessageFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected