mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
cmd/swarm/swarm-smoke-pss: flag for msg size
This commit is contained in:
parent
2052f31397
commit
455bef94b9
2 changed files with 11 additions and 2 deletions
|
|
@ -19,6 +19,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
"sort"
|
||||
"strconv"
|
||||
|
||||
"github.com/ethereum/go-ethereum/cmd/utils"
|
||||
gethmetrics "github.com/ethereum/go-ethereum/metrics"
|
||||
|
|
@ -44,6 +45,7 @@ var (
|
|||
verbosity int
|
||||
timeout int
|
||||
pssMessageCount int
|
||||
pssMessageSize int
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
@ -84,11 +86,17 @@ func main() {
|
|||
Destination: &timeout,
|
||||
},
|
||||
cli.IntFlag{
|
||||
Name: "pss-messages",
|
||||
Name: "msgcount",
|
||||
Value: 10,
|
||||
Usage: "number of pss messages that should be send in the pss smoke test",
|
||||
Destination: &pssMessageCount,
|
||||
},
|
||||
cli.IntFlag{
|
||||
Name: "msgbytes",
|
||||
Value: 128,
|
||||
Usage: "size of a randomly generated message. defined in bytes",
|
||||
Destination: &pssMessageSize,
|
||||
},
|
||||
}
|
||||
|
||||
app.Flags = append(app.Flags, []cli.Flag{
|
||||
|
|
@ -154,6 +162,7 @@ func emitMetrics(ctx *cli.Context) error {
|
|||
|
||||
tagsMap := utils.SplitTagsFlag(tags)
|
||||
tagsMap["version"] = gitCommit
|
||||
tagsMap["msgbytes"] = strconv.Itoa(pssMessageSize)
|
||||
|
||||
return influxdb.InfluxDBWithTagsOnce(gethmetrics.DefaultRegistry, endpoint, database, username, password, "swarm-smoke-pss.", tagsMap)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ func (s *pssSession) genJob(mode pssMode) pssJob {
|
|||
log.Trace("recv node", "pss_baseAddr", hexutil.Encode(recvNode.addr), "host", hosts[recvNodeIdx])
|
||||
|
||||
// create new message and add it to job index to check for receives
|
||||
randomMsg := testutil.RandomBytes(seed, 128)
|
||||
randomMsg := testutil.RandomBytes(seed, pssMessageSize)
|
||||
// change seed so that the next random message is different
|
||||
seed = seed + 1
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue