提交 4e6438aa 编写于 作者: G guru4elephant

condition on profile_server to return timestamp

上级 a3ac66fb
...@@ -126,14 +126,17 @@ int GeneralResponseOp::inference() { ...@@ -126,14 +126,17 @@ int GeneralResponseOp::inference() {
// timeline.Pause(); // timeline.Pause();
// response_time = timeline.ElapsedUS(); // response_time = timeline.ElapsedUS();
int64_t end = timeline.TimeStampUS();
VLOG(2) << "p size for input blob: " << input_blob->p_size; if (req->profile_server()) {
for (int i = 0; i < input_blob->p_size; ++i) { int64_t end = timeline.TimeStampUS();
res->add_profile_time(input_blob->time_stamp[i]); VLOG(2) << "p size for input blob: " << input_blob->p_size;
for (int i = 0; i < input_blob->p_size; ++i) {
res->add_profile_time(input_blob->time_stamp[i]);
}
// TODO(guru4elephant): find more elegant way to do this
res->add_profile_time(start);
res->add_profile_time(end);
} }
// TODO(guru4elephant): find more elegant way to do this
res->add_profile_time(start);
res->add_profile_time(end);
return 0; return 0;
} }
......
...@@ -124,16 +124,16 @@ int GeneralTextResponseOp::inference() { ...@@ -124,16 +124,16 @@ int GeneralTextResponseOp::inference() {
var_idx++; var_idx++;
} }
// timeline.Pause(); if (req->profile_server()) {
// response_time = timeline.ElapsedUS(); int64_t end = timeline.TimeStampUS();
int64_t end = timeline.TimeStampUS();
for (int i = 0; i < input_blob->p_size; ++i) {
for (int i = 0; i < input_blob->p_size; ++i) { res->add_profile_time(input_blob->time_stamp[i]);
res->add_profile_time(input_blob->time_stamp[i]); }
// TODO(guru4elephant): find more elegant way to do this
res->add_profile_time(start);
res->add_profile_time(end);
} }
// TODO(guru4elephant): find more elegant way to do this
res->add_profile_time(start);
res->add_profile_time(end);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册