Skip to content

Commit 82f8cb3

Browse files
committed
Add readme
1 parent c89c2fe commit 82f8cb3

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Feast Load Test Proxy
2+
3+
This is simple Go service generates load as part of the Feast testing suite. It sits between an HTTP based load testing tool as follows:
4+
5+
```
6+
[Load Testing Tool] --(http)--> [Feast Load Test Proxy] --(grpc)--> [Feast Serving]
7+
```
8+
9+
### Usage
10+
Start the proxy
11+
```
12+
LOAD_FEAST_SERVING_HOST=feast.serving.example.com LOAD_FEAST_SERVING_PORT=6566 go run main.go
13+
```
14+
```
15+
2020/07/24 14:00:02 Creating client to connect to Feast Serving at localhost:6566
16+
2020/07/24 14:00:02 Starting server on port:8080
17+
```
18+
19+
The following command simply echos the version of Feast Serving. Useful for testing network latency
20+
```
21+
curl localhost:8080/echo
22+
```
23+
24+
This command will send a single GetOnlineFeatures request to the configured Feast serving instance. The `entity_count` parameter is used to set how many entities will be sent (unique users in this case). The higher the number of entities the higher the expected latency.
25+
26+
```
27+
curl localhost:8080/send?entity_count=30
28+
```

main.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ func main() {
2626
log.Fatal(err.Error())
2727
}
2828

29+
log.Printf("Creating client to connect to Feast Serving at %s:%d", c.FeastServingHost, c.FeastServingPort)
2930
client, err := feast.NewGrpcClient(c.FeastServingHost, c.FeastServingPort)
3031
if err != nil {
3132
log.Fatalf("Could not connect to: %v", err)
3233
}
3334

34-
3535
http.HandleFunc("/send", func(w http.ResponseWriter, r *http.Request) {
3636
entityCountParam := r.URL.Query().Get("entity_count")
3737
if len(entityCountParam) < 1 {
@@ -63,8 +63,7 @@ func main() {
6363
w.WriteHeader(200)
6464
})
6565

66-
log.Printf("Starting server on port: %s\n", c.ListenPort)
67-
66+
log.Printf("Starting server on port %s\n", c.ListenPort)
6867
err = http.ListenAndServe(":"+c.ListenPort, nil)
6968
if err != nil {
7069
log.Fatalf("could not start server")

0 commit comments

Comments
 (0)