Skip to content

Commit e203126

Browse files
committed
use latest proto api
1 parent ff4db47 commit e203126

File tree

9 files changed

+115
-251
lines changed

9 files changed

+115
-251
lines changed

go_client/go.mod

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ go 1.17
44

55
require (
66
github.com/feast-dev/feast/sdk/go v0.9.2
7+
github.com/go-redis/redis/v8 v8.11.4
78
github.com/golang/protobuf v1.5.2
89
github.com/kelseyhightower/envconfig v1.4.0
910
github.com/montanaflynn/stats v0.6.6
@@ -12,8 +13,20 @@ require (
1213
)
1314

1415
require (
15-
golang.org/x/net v0.0.0-20200707034311-ab3426394381 // indirect
16-
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642 // indirect
17-
golang.org/x/text v0.3.3 // indirect
16+
cloud.google.com/go v0.62.0 // indirect
17+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
18+
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
19+
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
20+
github.com/opentracing-contrib/go-grpc v0.0.0-20200813121455-4a6760c71486 // indirect
21+
github.com/opentracing/opentracing-go v1.1.0 // indirect
22+
go.opencensus.io v0.22.4 // indirect
23+
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 // indirect
24+
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
25+
golang.org/x/sys v0.0.0-20210423082822-04245dca01da // indirect
26+
golang.org/x/text v0.3.6 // indirect
27+
google.golang.org/api v0.30.0 // indirect
28+
google.golang.org/appengine v1.6.6 // indirect
1829
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c // indirect
1930
)
31+
32+
replace github.com/feast-dev/feast/sdk/go => github.com/pyalex/feast/sdk/go v0.0.0-20211222163450-f97c0397ba60

go_client/go.sum

Lines changed: 61 additions & 0 deletions
Large diffs are not rendered by default.

go_client/main.go

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

java/config/application-overrides.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
feast:
22
registry: /data/registry.db
3+
project: feature_repo
34
active_store: online
45
stores:
56
- name: online

java/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: "3.9"
22
services:
33
feature-server:
4-
image: gcr.io/kf-feast/feature-server-java:develop
4+
image: gcr.io/kf-feast/feature-server-java:benchmark
55
ports:
66
- "6566:6566"
77
volumes:

java/protos/ServingService.proto

Lines changed: 0 additions & 96 deletions
This file was deleted.

java/protos/Value.proto

Lines changed: 0 additions & 109 deletions
This file was deleted.

java/request_generator.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,19 @@
1515
def generate_requests(features, entity_rows, entity_keyspace, requests, project, output):
1616
rs = []
1717
feature_refs = [
18-
dict(feature_table=f"feature_view_{feature_idx // FEATURES_PER_VIEW}",
19-
name=f"feature_{feature_idx}")
18+
f"feature_view_{feature_idx // FEATURES_PER_VIEW}:feature_{feature_idx}"
2019
for feature_idx in range(features)
2120
]
2221

2322
for _ in range(requests):
2423
entities = [
25-
dict(
26-
fields=dict(
27-
entity=dict(int64_val=int(key))
28-
)
29-
) for key in np.random.randint(1, entity_keyspace, entity_rows)
24+
dict(int64_val=int(key))
25+
for key in np.random.randint(1, entity_keyspace, entity_rows)
3026
]
3127

3228
rs.append(dict(
33-
features=feature_refs,
34-
entity_rows=entities,
35-
project=project
29+
features={"val": feature_refs},
30+
entities={"entity": {"val": entities}}
3631
))
3732

3833
with open(output, 'w') as f:

0 commit comments

Comments
 (0)