From 2bcf995cb8f16207fb9759dd7e71b752b7d4a5ce Mon Sep 17 00:00:00 2001 From: Hercules Merscher Date: Wed, 23 Nov 2022 11:50:05 +0100 Subject: [PATCH 1/4] go install needs version to be specified Signed-off-by: Hercules Merscher --- examples/rack/run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/rack/run b/examples/rack/run index eaaa6929..bda1c961 100755 --- a/examples/rack/run +++ b/examples/rack/run @@ -20,8 +20,8 @@ if ! installed vegeta; then fatal "Could not find go. Either run the examples manually or install" fi - go get github.com/tsenart/vegeta - go install github.com/tsenart/vegeta + go get github.com/tsenart/vegeta # older versions of Go + go install github.com/tsenart/vegeta@latest # newer versions of Go fi PORT=5000 From 6c10ae1e8e6d84e080ed8919af683a7dc22fa679 Mon Sep 17 00:00:00 2001 From: Hercules Merscher Date: Wed, 23 Nov 2022 11:50:38 +0100 Subject: [PATCH 2/4] better to replace the port 5000 with another one since Apple took it for AirPlay Apple took the port 5000 on the latest MacOS Monterey update, to be used by AirPlay. Many people are not happy with that. It can be turned on/off easily, however, a better experience would take that into consideration and use a different port, considering that MacOS is widely by developers. Signed-off-by: Hercules Merscher --- examples/rack/prometheus.yml | 2 +- examples/rack/run | 2 +- examples/rack/unicorn.conf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/rack/prometheus.yml b/examples/rack/prometheus.yml index ab9c4477..2e57f88d 100644 --- a/examples/rack/prometheus.yml +++ b/examples/rack/prometheus.yml @@ -10,4 +10,4 @@ scrape_configs: - job_name: "rack-example" static_configs: - targets: - - "localhost:5000" + - "localhost:5123" diff --git a/examples/rack/run b/examples/rack/run index bda1c961..effd17a2 100755 --- a/examples/rack/run +++ b/examples/rack/run @@ -24,7 +24,7 @@ if ! installed vegeta; then go install github.com/tsenart/vegeta@latest # newer versions of Go fi -PORT=5000 +PORT=5123 URL=http://127.0.0.1:${PORT}/ log "starting example server" diff --git a/examples/rack/unicorn.conf b/examples/rack/unicorn.conf index 290ca789..f1ffcfdc 100644 --- a/examples/rack/unicorn.conf +++ b/examples/rack/unicorn.conf @@ -1,3 +1,3 @@ -listen 5000 +listen 5123 worker_processes 1 preload_app true From e6649d51792f4cfa2fc3bdddcffcde0af88b9b13 Mon Sep 17 00:00:00 2001 From: Chris Sinjakli Date: Sat, 24 Dec 2022 22:36:55 +0000 Subject: [PATCH 3/4] Replace uses of port 5000 with 5123 in documentation Signed-off-by: Chris Sinjakli --- README.md | 2 +- examples/rack/README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7dac8426..2a7eba7b 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ run ->(_) { [200, {'content-type' => 'text/html'}, ['OK']] } ``` Start the server and have a look at the metrics endpoint: -[http://localhost:5000/metrics](http://localhost:5000/metrics). +[http://localhost:5123/metrics](http://localhost:5123/metrics). For further instructions and other scripts to get started, have a look at the integrated [example application](examples/rack/README.md). diff --git a/examples/rack/README.md b/examples/rack/README.md index e3497335..9c6188e6 100644 --- a/examples/rack/README.md +++ b/examples/rack/README.md @@ -33,8 +33,8 @@ bundle install bundle exec unicorn -c ./unicorn.conf ``` -You can now open the [example app](http://localhost:5000/) and its [metrics -page](http://localhost:5000/metrics) to inspect the output. The running +You can now open the [example app](http://localhost:5123/) and its [metrics +page](http://localhost:5123/metrics) to inspect the output. The running Prometheus server can be used to [play around with the metrics][rate-query]. [rate-query]: http://localhost:9090/graph#%5B%7B%22range_input%22%3A%221h%22%2C%22expr%22%3A%22rate(http_server_requests_total%5B1m%5D)%22%2C%22tab%22%3A0%7D%5D From ed59f9cda1bb2761fbd399e875526fbaf68f3421 Mon Sep 17 00:00:00 2001 From: Chris Sinjakli Date: Sat, 24 Dec 2022 22:38:22 +0000 Subject: [PATCH 4/4] Make Go version comment more specific Signed-off-by: Chris Sinjakli --- examples/rack/run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/rack/run b/examples/rack/run index effd17a2..bf89080f 100755 --- a/examples/rack/run +++ b/examples/rack/run @@ -20,8 +20,8 @@ if ! installed vegeta; then fatal "Could not find go. Either run the examples manually or install" fi - go get github.com/tsenart/vegeta # older versions of Go - go install github.com/tsenart/vegeta@latest # newer versions of Go + go get github.com/tsenart/vegeta # versions of Go < 1.18 + go install github.com/tsenart/vegeta@latest # versions of Go >= 1.18 fi PORT=5123