:tools: Update docs & fix build-docker Makefile target (#2584)

bump alpine version to 3.8
This commit is contained in:
Anton Kaliaev 2018-10-09 18:04:15 +04:00 committed by Alexander Simmerl
parent 8761b27489
commit 3fcb62b931
6 changed files with 105 additions and 65 deletions

View File

@ -1,4 +1,4 @@
FROM alpine:3.7 FROM alpine:3.8
WORKDIR /app WORKDIR /app
COPY tm-bench /app/tm-bench COPY tm-bench /app/tm-bench

View File

@ -1,5 +1,5 @@
DIST_DIRS := find * -type d -exec DIST_DIRS := find * -type d -exec
VERSION := $(shell perl -ne '/^var version.*"([^"]+)".*$$/ && print "v$$1\n"' main.go) VERSION := $(shell perl -ne '/^TMCoreSemVer = "([^"]+)"$$/ && print "v$$1\n"' ../../version/version.go)
all: build test install all: build test install
@ -37,7 +37,7 @@ dist: build-all
build-docker: build-docker:
rm -f ./tm-bench rm -f ./tm-bench
docker run -it --rm -v "$(PWD):/go/src/app" -w "/go/src/app" -e "CGO_ENABLED=0" golang:alpine go build -ldflags "-s -w" -o tm-bench docker run -it --rm -v "$(PWD)/../../:/go/src/github.com/tendermint/tendermint" -w "/go/src/github.com/tendermint/tendermint/tools/tm-bench" -e "CGO_ENABLED=0" golang:alpine go build -ldflags "-s -w" -o tm-bench
docker build -t "tendermint/bench" . docker build -t "tendermint/bench" .
clean: clean:

View File

@ -4,49 +4,72 @@ Tendermint blockchain benchmarking tool:
- https://github.com/tendermint/tools/tree/master/tm-bench - https://github.com/tendermint/tools/tree/master/tm-bench
For example, the following: For example, the following: `tm-bench -T 30 -r 10000 localhost:26657`
tm-bench -T 10 -r 1000 localhost:26657
will output: will output:
Stats Avg StdDev Max Total ```
Txs/sec 818 532 1549 9000 Stats Avg StdDev Max Total
Blocks/sec 0.818 0.386 1 9 Txs/sec 3981 1993 5000 119434
Blocks/sec 0.800 0.400 1 24
```
NOTE: **tm-bench only works with build-in `kvstore` ABCI application**. For it
to work with your application, you will need to modify `generateTx` function.
In the future, we plan to support scriptable transactions (see
[\#1938](https://github.com/tendermint/tendermint/issues/1938)).
## Quick Start ## Quick Start
### Docker
```
docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint init
docker run -it --rm -v "/tmp:/tendermint" -p "26657:26657" --name=tm tendermint/tendermint node --proxy_app=kvstore
docker run -it --rm --link=tm tendermint/bench tm:26657
```
### Using binaries
[Install Tendermint](https://github.com/tendermint/tendermint#install) [Install Tendermint](https://github.com/tendermint/tendermint#install)
This currently is setup to work on tendermint's develop branch. Please ensure
you are on that. (If not, update `tendermint` and `tmlibs` in gopkg.toml to use
the master branch.)
then run: then run:
tendermint init ```
tendermint node --proxy_app=kvstore tendermint init
tendermint node --proxy_app=kvstore
tm-bench localhost:26657 tm-bench localhost:26657
```
with the last command being in a seperate window. with the last command being in a separate window.
## Usage ## Usage
tm-bench [-c 1] [-T 10] [-r 1000] [-s 250] [endpoints] ```
Tendermint blockchain benchmarking tool.
Examples: Usage:
tm-bench [-c 1] [-T 10] [-r 1000] [-s 250] [endpoints] [-output-format <plain|json> [-broadcast-tx-method <async|sync|commit>]]
Examples:
tm-bench localhost:26657 tm-bench localhost:26657
Flags: Flags:
-T int -T int
Exit after the specified amount of time in seconds (default 10) Exit after the specified amount of time in seconds (default 10)
-broadcast-tx-method string
Broadcast method: async (no guarantees; fastest), sync (ensures tx is checked) or commit (ensures tx is checked and committed; slowest) (default "async")
-c int -c int
Connections to keep open per endpoint (default 1) Connections to keep open per endpoint (default 1)
-output-format string
Output format: plain or json (default "plain")
-r int -r int
Txs per second to send in a connection (default 1000) Txs per second to send in a connection (default 1000)
-s int -s int
Size per tx in bytes The size of a transaction in bytes, must be greater than or equal to 40. (default 250)
-v Verbose output -v Verbose output
```
## How stats are collected ## How stats are collected
@ -76,5 +99,7 @@ Each of the connections is handled via two separate goroutines.
## Development ## Development
make get_vendor_deps ```
make test make get_vendor_deps
make test
```

View File

@ -1,4 +1,4 @@
FROM alpine:3.6 FROM alpine:3.8
WORKDIR /app WORKDIR /app
COPY tm-monitor /app/tm-monitor COPY tm-monitor /app/tm-monitor

View File

@ -1,5 +1,5 @@
DIST_DIRS := find * -type d -exec DIST_DIRS := find * -type d -exec
VERSION := $(shell perl -ne '/^var version.*"([^"]+)".*$$/ && print "v$$1\n"' main.go) VERSION := $(shell perl -ne '/^TMCoreSemVer = "([^"]+)"$$/ && print "v$$1\n"' ../../version/version.go)
all: build test install all: build test install
@ -36,7 +36,7 @@ dist: build-all
build-docker: build-docker:
rm -f ./tm-monitor rm -f ./tm-monitor
docker run -it --rm -v "$(PWD):/go/src/github.com/tendermint/tools/tm-monitor" -w "/go/src/github.com/tendermint/tools/tm-monitor" -e "CGO_ENABLED=0" golang:alpine go build -ldflags "-s -w" -o tm-monitor docker run -it --rm -v "$(PWD)/../../:/go/src/github.com/tendermint/tendermint" -w "/go/src/github.com/tendermint/tendermint/tools/tm-monitor" -e "CGO_ENABLED=0" golang:alpine go build -ldflags "-s -w" -o tm-monitor
docker build -t "tendermint/monitor" . docker build -t "tendermint/monitor" .
clean: clean:

View File

@ -12,18 +12,22 @@ collecting and providing various statistics to the user:
Assuming your application is running in another container with the name Assuming your application is running in another container with the name
`app`: `app`:
docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint init ```
docker run -it --rm -v "/tmp:/tendermint" -p "26657:26657" --name=tm --link=app tendermint/tendermint node --proxy_app=tcp://app:26658 docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint init
docker run -it --rm -v "/tmp:/tendermint" -p "26657:26657" --name=tm --link=app tendermint/tendermint node --proxy_app=tcp://app:26658
docker run -it --rm -p "26670:26670" --link=tm tendermint/monitor tm:26657 docker run -it --rm -p "26670:26670" --link=tm tendermint/monitor tm:26657
```
If you don't have an application yet, but still want to try monitor out, If you don't have an application yet, but still want to try monitor out,
use `kvstore`: use `kvstore`:
docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint init ```
docker run -it --rm -v "/tmp:/tendermint" -p "26657:26657" --name=tm tendermint/tendermint node --proxy_app=kvstore docker run -it --rm -v "/tmp:/tendermint" tendermint/tendermint init
docker run -it --rm -v "/tmp:/tendermint" -p "26657:26657" --name=tm tendermint/tendermint node --proxy_app=kvstore
docker run -it --rm -p "26670:26670" --link=tm tendermint/monitor tm:26657 docker run -it --rm -p "26670:26670" --link=tm tendermint/monitor tm:26657
```
### Using Binaries ### Using Binaries
@ -31,40 +35,49 @@ use `kvstore`:
then run: then run:
tendermint init ```
tendermint node --proxy_app=kvstore tendermint init
tendermint node --proxy_app=kvstore
tm-monitor localhost:26657 tm-monitor localhost:26657
```
with the last command being in a seperate window. with the last command being in a separate window.
## Usage ## Usage
tm-monitor [-v] [-no-ton] [-listen-addr="tcp://0.0.0.0:26670"] [endpoints] ```
Tendermint monitor watches over one or more Tendermint core
applications, collecting and providing various statistics to the user.
Examples: Usage:
tm-monitor [-no-ton] [-listen-addr="tcp://0.0.0.0:26670"] [endpoints]
Examples:
# monitor single instance # monitor single instance
tm-monitor localhost:26657 tm-monitor localhost:26657
# monitor a few instances by providing comma-separated list of RPC endpoints # monitor a few instances by providing comma-separated list of RPC endpoints
tm-monitor host1:26657,host2:26657 tm-monitor host1:26657,host2:26657
Flags: Flags:
-listen-addr string -listen-addr string
HTTP and Websocket server listen address (default "tcp://0.0.0.0:26670") HTTP and Websocket server listen address (default "tcp://0.0.0.0:26670")
-no-ton -no-ton
Do not show ton (table of nodes) Do not show ton (table of nodes)
-v verbose logging ```
### RPC UI ### RPC UI
Run `tm-monitor` and visit http://localhost:26670 You should see the Run `tm-monitor` and visit http://localhost:26670 You should see the
list of the available RPC endpoints: list of the available RPC endpoints:
http://localhost:26670/status ```
http://localhost:26670/status/network http://localhost:26670/status
http://localhost:26670/monitor?endpoint=_ http://localhost:26670/status/network
http://localhost:26670/status/node?name=_ http://localhost:26670/monitor?endpoint=_
http://localhost:26670/unmonitor?endpoint=_ http://localhost:26670/status/node?name=_
http://localhost:26670/unmonitor?endpoint=_
```
The API is available as GET requests with URI encoded parameters, or as The API is available as GET requests with URI encoded parameters, or as
JSONRPC POST requests. The JSONRPC methods are also exposed over JSONRPC POST requests. The JSONRPC methods are also exposed over
@ -72,6 +85,8 @@ websocket.
## Development ## Development
make get_tools ```
make get_vendor_deps make get_tools
make test make get_vendor_deps
make test
```