From 62ce588ed60240c2554a032bc9acdeaadf0b6485 Mon Sep 17 00:00:00 2001 From: guru4elephant Date: Wed, 19 Feb 2020 23:50:25 +0800 Subject: [PATCH] fix go request --- go/client_app/imdb_client.go | 2 +- go/serving_client/serving_client_api.go | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/go/client_app/imdb_client.go b/go/client_app/imdb_client.go index aef823ed..079ddbbd 100644 --- a/go/client_app/imdb_client.go +++ b/go/client_app/imdb_client.go @@ -28,7 +28,7 @@ func main() { var config_file_path string config_file_path = os.Args[1] handle := serving_client.LoadModelConfig(config_file_path) - handle = serving_client.Connect("127.0.0.1", "9292", handle) + handle = serving_client.Connect("127.0.0.1", "9393", handle) test_file_path := os.Args[2] fi, err := os.Open(test_file_path) diff --git a/go/serving_client/serving_client_api.go b/go/serving_client/serving_client_api.go index 6fcdb945..bb77897f 100644 --- a/go/serving_client/serving_client_api.go +++ b/go/serving_client/serving_client_api.go @@ -43,11 +43,12 @@ type FetchInst struct { type Request struct { Insts []FeedInst `json:"insts"` FetchVarNames []string `json:"fetch_var_names"` + ProfileServer bool `json:"profile_server"` } type Response struct { Insts []FetchInst `json:"insts"` - MeanInferUs float32 `json:"mean_infer_us"` + ProfileTime []int64 `json:"profile_time"` } type Handle struct { @@ -125,9 +126,13 @@ func Predict(handle Handle, int_feed_map map[string][]int64, fetch []string) map inst.TensorArray = tensor_array + var profiletime bool + profiletime = false + req := &Request{ Insts: []FeedInst{inst}, - FetchVarNames: fetch} + FetchVarNames: fetch, + ProfileTime: profiletime} b, err := json.Marshal(req) -- GitLab