Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update examples #293

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
36 changes: 36 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Examples of using StellarStation-API

## To create a fake ground station server for testing Ground Station API clients:

- open [fakegroundstation](./fakegroundstation/)
- Please follow the steps in this file [README.md](./fakegroundstation/README.md) to run the fakegroundstation.

## To create a StellarStation API Fakeserver:

- open [fakeserver](./fakeserver/)
- Please follow the steps in this file [README.md](./fakeserver/README.md) to run the fake server.

## To use the Streaming API Benchmarking Tool:

### Golang:
- open [stream-benchmarker](./go/stream-benchmarker/)
- Please follow the steps in this file [README.md](./go/stream-benchmarker/README.md) to run the tool.

### Python:
- open [stream-benchmarker](./python/stream_benchmarker/)
- Please follow the steps in this file [README.md](./python/stream_benchmarker/README.md) to run the tool.

You can stream from fake server with this tool by following the instructions in the readme file.

## To use the Printing Client Tool:

### Java:
- open [printing-client](./java/printing-client/)
- Please follow the steps in this file [README.md](./java/printing-client/README.md) to run the tool.

### Python:
- open [printing-client](./python/printing-client/)
- Please follow the steps in this file [README.md](./python/printing-client/README.md) to run the tool.

You can stream from fake server with this tool by following the instructions in the readme file.

27 changes: 23 additions & 4 deletions examples/go/stream-benchmarker/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
# Streaming API Benchmarking Tool

Requires Go version 1.13
Requires Go version 1.17

To build from source:
## How to set up

```sh
go mod download
go mod tidy
```

## To run the tool with [fake server](../../fakeserver):
- you need to copy this [API key](../../fakeserver/src/main/jib/var/keys/api-key.json) to the current directory.
```bash
$ cp ../../fakeserver/src/main/jib/var/keys/api-key.json ./
```
go build
- uncomment ```InsecureSkipVerify: true,``` in benchmark/conn.go file inside ```tlsConfig := &tls.Config{}```
- and then run the following command:

```bash
$ go run . -E=localhost:8080
```

## To build from source:
```bash
$ go build
```

Usage:
Expand All @@ -19,7 +38,7 @@ Usage of ./benchmark:
-i duration
Reporting interval. (10s, 1m, etc.) During a pass, an output line will be generated for each reporting interval. (default 10s)
-k string
StellarStation API Key file (default "stellarstation-private-key.json")
StellarStation API Key file (default "api-key.json")
-o string
Write report output to a file instead of standard out
-s string
Expand Down
7 changes: 6 additions & 1 deletion examples/go/stream-benchmarker/benchmark/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ func Dial(apiKey string, apiURL string) (*grpc.ClientConn, error) {
return nil, err
}

tlsConfig := &tls.Config{}
tlsConfig := &tls.Config{
// we need InsecureSkipVerify only to stream from fake server
// please comment InsecureSkipVerify: true, with other servers
// disabling security checks is dangerous and should be avoided
// InsecureSkipVerify: true,
}

return grpc.Dial(
apiURL,
Expand Down
14 changes: 11 additions & 3 deletions examples/go/stream-benchmarker/go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
module github.com/infostellarinc/stellarstation-api/examples/go/stream-benchmarker

go 1.13
go 1.17

require (
github.com/cenkalti/backoff v2.2.1+incompatible
github.com/golang/protobuf v1.3.2
github.com/infostellarinc/go-stellarstation v0.4.4
github.com/mitchellh/go-homedir v1.1.0
google.golang.org/api v0.11.0
google.golang.org/grpc v1.24.0
)

require (
cloud.google.com/go v0.38.0 // indirect
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c // indirect
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b // indirect
golang.org/x/text v0.3.2 // indirect
google.golang.org/appengine v1.5.0 // indirect
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 // indirect
)
29 changes: 0 additions & 29 deletions examples/go/stream-benchmarker/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,35 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0 h1:ROfEUZz+Gh5pa62DJWXSaonyu3StP6EA6lPEXPI6mCo=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4=
github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM=
github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0 h1:28o5sBqPkBsMGnC6b4MvE2TzSr5/AT4c/1fLqVGIwlk=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c h1:964Od4U6p2jUkFxvCydnIczKteheJEzHRToSGK3Bnlw=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57 h1:eqyIo2HjKhKe/mJzTG8n4VqvLXIOEG+SLdDqX7xGtkY=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/infostellarinc/go-stellarstation v0.4.4 h1:IS62ywRCNv5v18d+4B5C2/lPG5q49cqmlc0UZB+iEqk=
github.com/infostellarinc/go-stellarstation v0.4.4/go.mod h1:ZUgU88DoZXjmZ2XrIyYfEWlnCV3sYWMkcsRUMvcwNUg=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024 h1:rBMNdlhTLzJjJSDIjNEXX1Pz3Hmwmz91v+zycvx9PJc=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/square/goprotowrap v0.0.0-20190116012208-bb93590db2db h1:a+mpyxG2mufLZFfR3NTr9KyWeBeGuuSdZCq+fVwCX88=
github.com/square/goprotowrap v0.0.0-20190116012208-bb93590db2db/go.mod h1:ss+tcSDAsyytwf1fIIsDTBbLS5uMvktdl8DvEZwELx4=
go.opencensus.io v0.21.0 h1:mU6zScU4U1YAFPHEHYk+3JC4SY7JxgkqS10ZOSyksNg=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4 h1:c2HOrn5iMezYjSlGPncknSEr/8x5LELb/ilJbXi9DEA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190409202823-959b441ac422 h1:QzoH/1pFpZguR8NrRHLcO6jKqfv2zpuSqZLgdm7ZmjI=
golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand All @@ -68,7 +47,6 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand All @@ -78,19 +56,14 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c h1:fqgJT0MGcGpPgpWU7VRdRjuArfcOvC4AoJmILihzhDg=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A=
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
google.golang.org/api v0.11.0 h1:n/qM3q0/rV2F0pox7o0CvNhlPvZAo7pLbef122cbLJ0=
google.golang.org/api v0.11.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.5.0 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c=
Expand All @@ -106,6 +79,4 @@ google.golang.org/grpc v1.24.0 h1:vb/1TCsVn3DcJlQ0Gs1yB1pKI6Do2/QNwxdKqmc/b0s=
google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc h1:/hemPrYIhOhy8zYrNj+069zDB68us2sMGsfkFJO0iZs=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
4 changes: 2 additions & 2 deletions examples/go/stream-benchmarker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
)

func main() {
apiKey := "stellarstation-private-key.json"
apiKey := "api-key.json"
endpoint := "api.stellarstation.com:443"
satelliteID := "5"
interval := 10 * time.Second
Expand Down Expand Up @@ -95,7 +95,7 @@ func main() {
message := streamResponse.Telemetry
if len(message.Data) != 0 {
planID := streamResponse.PlanId
if passStarted == false {
if !passStarted {
if planID != "" {
log.Printf("Receiving messages for Plan ID %v", planID)
passStarted = true
Expand Down
14 changes: 14 additions & 0 deletions examples/java/printing-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,17 @@

A simple example client that prints received telemetry and sends commands at a fixed interval. Shows
the basics of writing code to integrate with the StellarStation API. Only works with [Fakeserver](../../fakeserver).

## Running the server with Gradle

Users of this repository can just use the `run` task.

```bash
$ ./gradlew :examples:java:printing-client:run
```

If using a lower version of Java than Java 10, you will need to specify the build file explicitly.

```bash
$ ./gradlew -b examples/java/printing-client/build.gradle run
```
27 changes: 22 additions & 5 deletions examples/python/printing-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,33 @@
A simple example client that prints received telemetry and sends commands at a fixed interval. Shows
the basics of writing code to integrate with the StellarStation API. Only works with [Fakeserver](../../fakeserver).

## Create and activate a venv for printing-client
## Setting up the environment:

## Install python 3 dependencies and start virtual environment:

- For linux users:

```bash
$ python3 -m venv venv
$ source venv/bin/activate
$ sudo apt update && sudo apt install python3 python3-venv
```

- For mac users: you need to install homebrew
```bash
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

## Install requirements
- After that or if you already have homebrew installed:
```bash
$ pip install -r requirements.txt
$ brew install python3
$ pip3 install virtualenv
```

- Install dependencies and start virtual environment:

```bash
$ python3 -m venv venv
$ source venv/bin/activate
$ pip3 install -r requirements.txt
```

## Try it out!
Expand Down
4 changes: 2 additions & 2 deletions examples/python/printing-client/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cachetools==4.2.2
google-auth==1.30.0
grpcio==1.37.1
grpcio==1.44.0
protobuf==3.17.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
rsa==4.7.2
six==1.16.0
stellarstation==0.10.0
stellarstation==0.11.0
60 changes: 48 additions & 12 deletions examples/python/stream_benchmarker/README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,63 @@
# Streaming API Benchmarking Tool

Steps to run(commands Debian):
## Setting up the environment:

* Install python 3 dependencies and start virtual environment:
### Install python 3 dependencies and start virtual environment:

```
- For linux users:

```sh
sudo apt update && sudo apt install python3 python3-venv
```

- For mac users: you need to install homebrew
```sh
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

- After that or if you already have homebrew installed:
```sh
brew install python3
pip3 install virtualenv
```

- Install dependencies and start virtual environment:

```sh
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip3 install -r requirements.txt
```

* Set API key with --key arg (default 'stellarstation-private-key.json')
* Set ENDPOINT with --endpoint arg (default 'api.stellarstation.com:443')
* Set SATTELITE ID with --id arg (default '5')
* Set Reporting INTERVAL with --interval arg (default '10' seconds)
* Set Output DIRECTORY with --directory arg (default None)

* Output will write to a file if the Output DIRECTORY is set
## To run the app:
Use the following command:

```
python3 stream_benchmark.py
```

* CTRL-C will stop the test and write output to a file
### To run the app with [fake server]("../../../../fakeserver/"):
- you need to copy this [API key](../../fakeserver/src/main/jib/var/keys/api-key.json) to the current directory.
```sh
cp ../../fakeserver/src/main/jib/var/keys/api-key.json ./
```
- and then run the following command:

```
python3 stream_benchmark.py --endpoint=localhost:8080
```

### You can add the following flags to the run command:

- Set API key with --key arg (default 'api-key.json')
- Set ENDPOINT with --endpoint arg (default 'api.stellarstation.com:443')
- Set SATTELITE ID with --id arg (default '5')
- Set Reporting INTERVAL with --interval arg (default '10' seconds)
- Set Output DIRECTORY with --directory arg (default None)

## Notes:

- Output will write to a file if the Output DIRECTORY is set.
- CTRL-C will stop the test and write output to a file.
- Currently stream_benchmark.py is not compatible with python 3.8 and greater.
you need to use python 3.7 or older versions of python 3 to run it.
4 changes: 2 additions & 2 deletions examples/python/stream_benchmarker/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ google-cloud-core==0.29.1
google-cloud-storage==1.15.0
google-resumable-media==0.3.2
googleapis-common-protos==1.5.10
grpcio==1.20.1
grpcio==1.44.0
idna==2.8
packaging==19.0
pip-upgrader==1.4.12
Expand All @@ -20,5 +20,5 @@ pyparsing==2.4.0
pytz==2019.1
rsa==4.7
six==1.12.0
stellarstation==0.3.0
stellarstation==0.11.0
terminaltables==3.1.0
Loading