Browse Source

[tm-bench] updated deps

pull/1943/head
Anton Kaliaev 7 years ago
parent
commit
73ced040a3
No known key found for this signature in database GPG Key ID: 7B6881D965918214
3 changed files with 58 additions and 78 deletions
  1. +48
    -69
      tm-bench/glide.lock
  2. +4
    -3
      tm-bench/main.go
  3. +6
    -6
      tm-bench/transacter.go

+ 48
- 69
tm-bench/glide.lock View File

@ -1,59 +1,39 @@
hash: 795aa94747f3d877df3ea1ec134e9a34e1c46713dd6eb59b6fdd6a33cb698234 hash: 795aa94747f3d877df3ea1ec134e9a34e1c46713dd6eb59b6fdd6a33cb698234
updated: 2017-04-20T19:19:22.26004087-04:00
updated: 2017-07-28T22:01:53.225543833Z
imports: imports:
- name: github.com/btcsuite/btcd - name: github.com/btcsuite/btcd
version: 583684b21bfbde9b5fc4403916fd7c807feb0289
version: 47885ab8702485be6b6f87a03d4f3be0bc5c982c
subpackages: subpackages:
- btcec - btcec
- name: github.com/BurntSushi/toml
version: 99064174e013895bbd9b025c31100bd1d9b590ca
- name: github.com/go-kit/kit - name: github.com/go-kit/kit
version: b6f30a2e0632f5722fb26d8765d726335b79d3e6
version: 19463ea8b215413a29c3513aa3a76181f4bac58d
subpackages: subpackages:
- log - log
- log/level
- log/term - log/term
- term - term
- name: github.com/go-logfmt/logfmt - name: github.com/go-logfmt/logfmt
version: 390ab7935ee28ec6b286364bba9b4dd6410cb3d5 version: 390ab7935ee28ec6b286364bba9b4dd6410cb3d5
- name: github.com/go-stack/stack - name: github.com/go-stack/stack
version: 100eb0c0a9c5b306ca2fb4f165df21d80ada4b82
version: 817915b46b97fd7bb80e8ab6b69f01a53ac3eebf
- name: github.com/golang/protobuf - name: github.com/golang/protobuf
version: 69b215d01a5606c843240eab4937eab3acee6530
version: 748d386b5c1ea99658fd69fe9f03991ce86a90c1
subpackages: subpackages:
- proto - proto
- name: github.com/golang/snappy
version: 553a641470496b2327abcac10b36396bd98e45c9
- ptypes
- ptypes/any
- ptypes/duration
- ptypes/timestamp
- name: github.com/gorilla/websocket - name: github.com/gorilla/websocket
version: 3ab3a8b8831546bd18fd182c20687ca853b2bb13
- name: github.com/jmhodges/levigo
version: c42d9e0ca023e2198120196f842701bb4c55d7b9
version: a69d9f6de432e2c6b296a947d8a5ee88f68522cf
- name: github.com/kr/logfmt - name: github.com/kr/logfmt
version: b84e30acd515aadc4b783ad4ff83aff3299bdfe0 version: b84e30acd515aadc4b783ad4ff83aff3299bdfe0
- name: github.com/mattn/go-colorable
version: d898aa9fb31c91f35dd28ca75db377eff023c076
- name: github.com/mattn/go-isatty
version: dda3de49cbfcec471bd7a70e6cc01fcc3ff90109
- name: github.com/pkg/errors - name: github.com/pkg/errors
version: bfd5150e4e41705ded2129ec33379de1cb90b513
version: c605e284fe17294bda444b34710735b29d1a9d90
- name: github.com/rcrowley/go-metrics - name: github.com/rcrowley/go-metrics
version: 1f30fe9094a513ce4c700b9a54458bbb0c96996c version: 1f30fe9094a513ce4c700b9a54458bbb0c96996c
- name: github.com/syndtr/goleveldb
version: 3c5717caf1475fd25964109a0fc640bd150fce43
subpackages:
- leveldb
- leveldb/cache
- leveldb/comparer
- leveldb/errors
- leveldb/filter
- leveldb/iterator
- leveldb/journal
- leveldb/memdb
- leveldb/opt
- leveldb/storage
- leveldb/table
- leveldb/util
- name: github.com/tendermint/abci - name: github.com/tendermint/abci
version: 56e13d87f4e3ec1ea756957d6b23caa6ebcf0998
version: 864d1f80b36b440bde030a5c18d8ac3aa8c2949d
subpackages: subpackages:
- types - types
- name: github.com/tendermint/ed25519 - name: github.com/tendermint/ed25519
@ -61,53 +41,42 @@ imports:
subpackages: subpackages:
- edwards25519 - edwards25519
- extra25519 - extra25519
- name: github.com/tendermint/go-common
version: f9e3db037330c8a8d61d3966de8473eaf01154fa
- name: github.com/tendermint/go-config
version: 620dcbbd7d587cf3599dedbf329b64311b0c307a
- name: github.com/tendermint/go-crypto - name: github.com/tendermint/go-crypto
version: 0ca2c6fdb0706001ca4c4b9b80c9f428e8cf39da
- name: github.com/tendermint/go-data
version: e7fcc6d081ec8518912fcdc103188275f83a3ee5
- name: github.com/tendermint/go-db
version: 9643f60bc2578693844aacf380a7c32e4c029fee
- name: github.com/tendermint/go-events
version: fddee66d90305fccb6f6d84d16c34fa65ea5b7f6
- name: github.com/tendermint/go-flowrate
version: a20c98e61957faa93b4014fbd902f20ab9317a6a
subpackages:
- flowrate
- name: github.com/tendermint/go-logger
version: cefb3a45c0bf3c493a04e9bcd9b1540528be59f2
- name: github.com/tendermint/go-merkle
version: 714d4d04557fd068a7c2a1748241ce8428015a96
- name: github.com/tendermint/go-p2p
version: 17124989a93774833df33107fbf17157a7f8ef31
subpackages:
- upnp
version: 95b7c9e09c49b91bfbb71bb63dd514eb55450f16
- name: github.com/tendermint/go-rpc - name: github.com/tendermint/go-rpc
version: 1a42f946dc6bcd88f9f58c7f2fb86f785584d793
version: 15d5b2ac497da95cd2dceb9c087910ccec4dacb2
subpackages: subpackages:
- client - client
- types - types
- name: github.com/tendermint/go-wire - name: github.com/tendermint/go-wire
version: 2f3b7aafe21c80b19b6ee3210ecb3e3d07c7a471
- name: github.com/tendermint/log15
version: ae0f3d6450da9eac7074b439c8e1c3cabf0d5ce6
version: 5f88da3dbc1a72844e6dfaf274ce87f851d488eb
subpackages: subpackages:
- term
- data
- name: github.com/tendermint/tendermint - name: github.com/tendermint/tendermint
version: 083fe959e25421fca3d41298d9111167a3b47122
version: b467515719e686e4678e6da4e102f32a491b85a0
subpackages: subpackages:
- config
- p2p
- p2p/upnp
- rpc/core/types - rpc/core/types
- rpc/lib/client
- rpc/lib/types
- types - types
- name: github.com/tendermint/tmlibs
version: 2f6f3e6aa70bb19b70a6e73210273fa127041070
subpackages:
- common
- events
- flowrate
- log
- merkle
- name: github.com/tendermint/tools - name: github.com/tendermint/tools
version: 12ce526668e384100afd32686ec7db3749423d51
version: f427590622211c845626493e2adfb09e12c15e61
subpackages: subpackages:
- tm-monitor/eventmeter - tm-monitor/eventmeter
- tm-monitor/monitor - tm-monitor/monitor
- name: golang.org/x/crypto - name: golang.org/x/crypto
version: 453249f01cfeb54c3d549ddb75ff152ca243f9d8
version: 558b6879de74bc843225cde5686419267ff707ca
subpackages: subpackages:
- curve25519 - curve25519
- nacl/box - nacl/box
@ -118,7 +87,7 @@ imports:
- ripemd160 - ripemd160
- salsa20/salsa - salsa20/salsa
- name: golang.org/x/net - name: golang.org/x/net
version: 906cda9512f77671ab44f8c8563b13a8e707b230
version: f5079bd7f6f74e23c4d65efa0f4ce14cbd6a3c0f
subpackages: subpackages:
- context - context
- http2 - http2
@ -127,21 +96,31 @@ imports:
- internal/timeseries - internal/timeseries
- lex/httplex - lex/httplex
- trace - trace
- name: golang.org/x/sys
version: 76cc09b634294339fa19ec41b5f2a0b3932cea8b
- name: golang.org/x/text
version: 836efe42bb4aa16aaa17b9c155d8813d336ed720
subpackages:
- secure/bidirule
- transform
- unicode/bidi
- unicode/norm
- name: google.golang.org/genproto
version: b0a3dcfcd1a9bd48e63634bd8802960804cf8315
subpackages: subpackages:
- unix
- googleapis/rpc/status
- name: google.golang.org/grpc - name: google.golang.org/grpc
version: 8b2e129857480cb0f07ef7d9d10b8b252c7ac984
version: 971efedc2078cb1efd8111d12432813084bc628d
subpackages: subpackages:
- codes - codes
- credentials - credentials
- grpclb/grpc_lb_v1
- grpclog - grpclog
- internal - internal
- keepalive
- metadata - metadata
- naming - naming
- peer - peer
- stats - stats
- status
- tap - tap
- transport - transport
testImports: [] testImports: []

+ 4
- 3
tm-bench/main.go View File

@ -8,10 +8,11 @@ import (
"text/tabwriter" "text/tabwriter"
"time" "time"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/term" "github.com/go-kit/kit/log/term"
metrics "github.com/rcrowley/go-metrics" metrics "github.com/rcrowley/go-metrics"
tmtypes "github.com/tendermint/tendermint/types" tmtypes "github.com/tendermint/tendermint/types"
"github.com/tendermint/tmlibs/log"
"github.com/tendermint/tools/tm-monitor/monitor" "github.com/tendermint/tools/tm-monitor/monitor"
) )
@ -63,7 +64,7 @@ Examples:
} }
return term.FgBgColor{} return term.FgBgColor{}
} }
logger = term.NewLogger(os.Stdout, log.NewLogfmtLogger, colorFn)
logger = log.NewTMLoggerWithColorFn(log.NewSyncWriter(os.Stdout), colorFn)
} }
fmt.Printf("Running %ds test @ %s\n", duration, flag.Arg(0)) fmt.Printf("Running %ds test @ %s\n", duration, flag.Arg(0))
@ -123,7 +124,7 @@ func startNodes(endpoints []string, blockCh chan<- tmtypes.Header, blockLatencyC
for i, e := range endpoints { for i, e := range endpoints {
n := monitor.NewNode(e) n := monitor.NewNode(e)
n.SetLogger(log.With(logger, "node", e))
n.SetLogger(logger.With("node", e))
n.SendBlocksTo(blockCh) n.SendBlocksTo(blockCh)
n.SendBlockLatenciesTo(blockLatencyCh) n.SendBlockLatenciesTo(blockLatencyCh)
if err := n.Start(); err != nil { if err := n.Start(); err != nil {


+ 6
- 6
tm-bench/transacter.go View File

@ -11,11 +11,11 @@ import (
"sync" "sync"
"time" "time"
"github.com/go-kit/kit/log"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
"github.com/pkg/errors" "github.com/pkg/errors"
rpctypes "github.com/tendermint/go-rpc/types" rpctypes "github.com/tendermint/go-rpc/types"
"github.com/tendermint/tmlibs/log"
) )
const ( const (
@ -91,7 +91,7 @@ func (t *transacter) receiveLoop(connIndex int) {
_, _, err := c.ReadMessage() _, _, err := c.ReadMessage()
if err != nil { if err != nil {
if websocket.IsUnexpectedCloseError(err, websocket.CloseNormalClosure) { if websocket.IsUnexpectedCloseError(err, websocket.CloseNormalClosure) {
t.logger.Log("err", errors.Wrap(err, "failed to read response"))
t.logger.Error("failed to read response", "err", err)
} }
return return
} }
@ -104,7 +104,7 @@ func (t *transacter) receiveLoop(connIndex int) {
// sendLoop generates transactions at a given rate. // sendLoop generates transactions at a given rate.
func (t *transacter) sendLoop(connIndex int) { func (t *transacter) sendLoop(connIndex int) {
c := t.conns[connIndex] c := t.conns[connIndex]
logger := log.With(t.logger, "addr", c.RemoteAddr())
logger := t.logger.With("addr", c.RemoteAddr())
var txNumber = 0 var txNumber = 0
@ -142,12 +142,12 @@ func (t *transacter) sendLoop(connIndex int) {
timeToSend := time.Now().Sub(startTime) timeToSend := time.Now().Sub(startTime)
time.Sleep(time.Second - timeToSend) time.Sleep(time.Second - timeToSend)
logger.Log("event", fmt.Sprintf("sent %d transactions", t.Rate), "took", timeToSend)
logger.Info(fmt.Sprintf("sent %d transactions", t.Rate), "took", timeToSend)
case <-pingsTicker.C: case <-pingsTicker.C:
// Right now go-rpc server closes the connection in the absence of pings // Right now go-rpc server closes the connection in the absence of pings
c.SetWriteDeadline(time.Now().Add(sendTimeout)) c.SetWriteDeadline(time.Now().Add(sendTimeout))
if err := c.WriteMessage(websocket.PingMessage, []byte{}); err != nil { if err := c.WriteMessage(websocket.PingMessage, []byte{}); err != nil {
logger.Log("err", errors.Wrap(err, "failed to write ping message"))
logger.Error("failed to write ping message", "err", err)
} }
} }
@ -157,7 +157,7 @@ func (t *transacter) sendLoop(connIndex int) {
c.SetWriteDeadline(time.Now().Add(sendTimeout)) c.SetWriteDeadline(time.Now().Add(sendTimeout))
err := c.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, "")) err := c.WriteMessage(websocket.CloseMessage, websocket.FormatCloseMessage(websocket.CloseNormalClosure, ""))
if err != nil { if err != nil {
logger.Log("err", errors.Wrap(err, "failed to write close message"))
logger.Error("failed to write close message", "err", err)
} }
return return


Loading…
Cancel
Save