Update benchmark timings to stress peerstores more

This commit is contained in:
Cole Brown 2018-06-26 20:18:25 -04:00
parent 6a9cba0e1b
commit 1d5ab0b868
2 changed files with 3 additions and 2 deletions

View File

@ -6,10 +6,11 @@ import (
"testing" "testing"
"time" "time"
"math/rand"
"github.com/mr-tron/base58/base58" "github.com/mr-tron/base58/base58"
ma "github.com/multiformats/go-multiaddr" ma "github.com/multiformats/go-multiaddr"
mh "github.com/multiformats/go-multihash" mh "github.com/multiformats/go-multihash"
"math/rand"
) )
type peerpair struct { type peerpair struct {

View File

@ -331,7 +331,7 @@ func benchmarkPeerstoreRateLimited(ps Peerstore) func(*testing.B) {
producer := make(chan *peerpair, 100) producer := make(chan *peerpair, 100)
addrs := make(chan *peerpair, 100) addrs := make(chan *peerpair, 100)
go rateLimitedAddressProducer(b, addrs, producer, 10000, time.Millisecond, 500*time.Microsecond) go rateLimitedAddressProducer(b, addrs, producer, 60000, 100*time.Microsecond, 100*time.Microsecond)
b.ResetTimer() b.ResetTimer()
for { for {