Skip to content

Commit

Permalink
rename metrics flags
Browse files Browse the repository at this point in the history
  • Loading branch information
neufeldtech committed Mar 1, 2022
1 parent 571d94b commit 0d65baf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions METRICS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

### Runtime Metrics

To enable runtime metrics related to the state of the go runtime, build version, process info, use the `-enable-runtime-metrics` flag.
To enable runtime metrics related to the state of the go runtime, build version, process info, use the `-runtime-metrics` flag.

For more details, see below:
- [NewGoCollector](https://pkg.go.dev/github.com/prometheus/client_golang/prometheus/collectors#NewGoCollector)
Expand All @@ -16,7 +16,7 @@ For more details, see below:

### Proxy Metrics

To enable metrics related to toxiproxy internals, use the `-enable-proxy-metrics` flag.
To enable metrics related to toxiproxy internals, use the `-proxy-metrics` flag.
#### toxiproxy_proxy_received_bytes_total / toxiproxy_proxy_sent_bytes_total

The total number of bytes received/sent on a given proxy link in a given direction
Expand Down
4 changes: 2 additions & 2 deletions cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ func parseArguments() cliArguments {
"JSON file containing proxies to create on startup")
flag.Int64Var(&result.seed, "seed", time.Now().UTC().UnixNano(),
"Seed for randomizing toxics with")
flag.BoolVar(&result.runtimeMetrics, "enable-runtime-metrics", false,
flag.BoolVar(&result.runtimeMetrics, "runtime-metrics", false,
`enable runtime-related prometheus metrics (default "false")`)
flag.BoolVar(&result.proxyMetrics, "enable-proxy-metrics", false,
flag.BoolVar(&result.proxyMetrics, "proxy-metrics", false,
`enable toxiproxy-specific prometheus metrics (default "false")`)
flag.BoolVar(&result.printVersion, "version", false,
`print the version (default "false")`)
Expand Down
4 changes: 2 additions & 2 deletions scripts/test-e2e
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ wait_for_url() {
}

# Stop all background jobs on exit
trap 'pkill -15 -f "dist/toxiproxy-server -enable-proxy-metrics -enable-runtime-metrics$"; pkill -15 -f "exe/endpoint$"' \
trap 'pkill -15 -f "dist/toxiproxy-server -proxy-metrics -runtime-metrics$"; pkill -15 -f "exe/endpoint$"' \
EXIT SIGINT SIGTERM

echo "=== Starting Web service"
Expand All @@ -17,7 +17,7 @@ go run test/e2e/endpoint.go 2>&1 | sed -e 's/^/[web] /' &

echo "=== Starting Toxiproxy"

LOG_LEVEL=debug ./dist/toxiproxy-server -enable-proxy-metrics -enable-runtime-metrics 2>&1 | sed -e 's/^/[toxiproxy] /' &
LOG_LEVEL=debug ./dist/toxiproxy-server -proxy-metrics -runtime-metrics 2>&1 | sed -e 's/^/[toxiproxy] /' &

echo "=== Wait when service are available"

Expand Down

0 comments on commit 0d65baf

Please sign in to comment.