@@ -44,7 +44,7 @@ func main() {
4444 }
4545 client := serving .NewServingServiceClient (conn )
4646
47- reqCh := make (chan * serving.GetOnlineFeaturesRequestV2 , 0 )
47+ reqCh := make (chan * serving.GetOnlineFeaturesRequest , 0 )
4848 resultCh := make (chan time.Duration , c .Requests )
4949
5050 ctx , _ := context .WithCancel (context .Background ())
@@ -78,9 +78,11 @@ func main() {
7878 log .Printf ("95p: %fms" , p95 )
7979 p99 , _ := stats .Percentile (results , 99 )
8080 log .Printf ("99p: %fms" , p99 )
81+ rps := 1000 / mean * float64 (c .Concurrency )
82+ log .Printf ("RPS: %.2f" , rps )
8183}
8284
83- func run (c Config , requests []* serving.GetOnlineFeaturesRequestV2 , reqCh chan * serving.GetOnlineFeaturesRequestV2 ) {
85+ func run (c Config , requests []* serving.GetOnlineFeaturesRequest , reqCh chan * serving.GetOnlineFeaturesRequest ) {
8486 ticker := time .NewTicker (time .Duration (1000000 / c .RPS ) * time .Microsecond )
8587 reqCounter := 0
8688 reqIdx := 0
@@ -104,7 +106,7 @@ func run(c Config, requests []*serving.GetOnlineFeaturesRequestV2, reqCh chan *s
104106 }
105107}
106108
107- func readRequests (reqPath string ) []* serving.GetOnlineFeaturesRequestV2 {
109+ func readRequests (reqPath string ) []* serving.GetOnlineFeaturesRequest {
108110 file , err := os .Open (reqPath )
109111 if err != nil {
110112 log .Fatal (err )
@@ -115,30 +117,32 @@ func readRequests(reqPath string) []*serving.GetOnlineFeaturesRequestV2 {
115117 log .Fatal (err )
116118 }
117119
118- requests := make ([]* serving.GetOnlineFeaturesRequestV2 , 0 )
120+ requests := make ([]* serving.GetOnlineFeaturesRequest , 0 )
119121 for jsonDecoder .More () {
120- req := serving.GetOnlineFeaturesRequestV2 {}
122+ req := serving.GetOnlineFeaturesRequest {}
121123 err := jsonpb .UnmarshalNext (jsonDecoder , & req )
122124 if err != nil {
123125 log .Fatal (err )
124126 }
125127 requests = append (requests , & req )
126128 }
127- //println(proto.MarshalTextString(requests[2]))
128- //println(len(requests))
129129 return requests
130130}
131131
132- func worker (workerId int , ctx context.Context , client serving.ServingServiceClient , reqCh <- chan * serving.GetOnlineFeaturesRequestV2 , resultCh chan time.Duration ) {
132+ func worker (workerId int , ctx context.Context , client serving.ServingServiceClient , reqCh <- chan * serving.GetOnlineFeaturesRequest , resultCh chan time.Duration ) {
133133 defer wg .Done ()
134134
135135 for req := range reqCh {
136136 //log.Printf("Sending request. WorkerId %d", workerId)
137137 start := time .Now ()
138138
139- _ , err := client .GetOnlineFeaturesV2 (ctx , req )
139+ //_, err := client.GetOnlineFeatures(ctx, req)
140+ client .GetOnlineFeatures (ctx , req )
140141 duration := time .Since (start )
141- log .Printf ("Retrieval %s; Success: %t. WorkerId: %d" , duration , err == nil , workerId )
142+
143+ //println(prototext.Format(resp))
144+
145+ //log.Printf("Retrieval %s; Success: %t. WorkerId: %d", duration, err == nil, workerId)
142146
143147 resultCh <- duration
144148 }
0 commit comments