提交 47a351c6 编写于 作者: G guru4elephant

add profile server argument on request, if profile_server=true, timestamp of...

add profile server argument on request, if profile_server=true, timestamp of server will be returned
上级 c7bef91b
...@@ -38,6 +38,7 @@ message FetchInst { ...@@ -38,6 +38,7 @@ message FetchInst {
message Request { message Request {
repeated FeedInst insts = 1; repeated FeedInst insts = 1;
repeated string fetch_var_names = 2; repeated string fetch_var_names = 2;
optional bool profile_server = 3 [ default = false ];
}; };
message Response { message Response {
......
...@@ -38,6 +38,7 @@ message FetchInst { ...@@ -38,6 +38,7 @@ message FetchInst {
message Request { message Request {
repeated FeedInst insts = 1; repeated FeedInst insts = 1;
repeated string fetch_var_names = 2; repeated string fetch_var_names = 2;
optional bool profile_server = 3 [ default = false ];
}; };
message Response { message Response {
......
...@@ -17,6 +17,7 @@ from .proto import sdk_configure_pb2 as sdk ...@@ -17,6 +17,7 @@ from .proto import sdk_configure_pb2 as sdk
from .proto import general_model_config_pb2 as m_config from .proto import general_model_config_pb2 as m_config
import google.protobuf.text_format import google.protobuf.text_format
import time import time
import sys
int_type = 0 int_type = 0
float_type = 1 float_type = 1
...@@ -87,6 +88,9 @@ class Client(object): ...@@ -87,6 +88,9 @@ class Client(object):
# map feed names to index # map feed names to index
self.client_handle_ = PredictorClient() self.client_handle_ = PredictorClient()
self.client_handle_.init(path) self.client_handle_.init(path)
read_env_flags = ["profile_client", "profile_server"]
self.client_handle_.init_gflags([sys.argv[0]] +
["--tryfromenv=" + ",".join(read_env_flags)])
self.feed_names_ = [var.alias_name for var in model_conf.feed_var] self.feed_names_ = [var.alias_name for var in model_conf.feed_var]
self.fetch_names_ = [var.alias_name for var in model_conf.fetch_var] self.fetch_names_ = [var.alias_name for var in model_conf.fetch_var]
self.feed_shapes_ = [var.shape for var in model_conf.feed_var] self.feed_shapes_ = [var.shape for var in model_conf.feed_var]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册