提交 4a7a5755 编写于 作者: S ShiningZhang

fix bug: client core while low version server do not have profile_time

上级 eb16b33f
...@@ -184,10 +184,12 @@ int ServingBrpcClient::predict(const PredictorInputs& inputs, ...@@ -184,10 +184,12 @@ int ServingBrpcClient::predict(const PredictorInputs& inputs,
oss << "op" << i << "=" << t << "ms,"; oss << "op" << i << "=" << t << "ms,";
} }
} }
if (op_num > 0) {
int i = op_num - 1; int i = op_num - 1;
double server_cost = (res.profile_time(i * 2 + 1) double server_cost = (res.profile_time(i * 2 + 1)
- res.profile_time(i * 2)) / 1000.0; - res.profile_time(i * 2)) / 1000.0;
oss << "server_cost=" << server_cost << "ms."; oss << "server_cost=" << server_cost << "ms.";
}
LOG(INFO) << oss.str(); LOG(INFO) << oss.str();
return 0; return 0;
......
...@@ -449,10 +449,12 @@ int PredictorClient::numpy_predict( ...@@ -449,10 +449,12 @@ int PredictorClient::numpy_predict(
oss << "op" << i << "=" << t << "ms,"; oss << "op" << i << "=" << t << "ms,";
} }
} }
if (op_num > 0) {
int i = op_num - 1; int i = op_num - 1;
double server_cost = (res.profile_time(i * 2 + 1) double server_cost = (res.profile_time(i * 2 + 1)
- res.profile_time(i * 2)) / 1000.0; - res.profile_time(i * 2)) / 1000.0;
oss << "server_cost=" << server_cost << "ms."; oss << "server_cost=" << server_cost << "ms.";
}
LOG(INFO) << oss.str(); LOG(INFO) << oss.str();
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册