diff --git a/cmd/swarm/swarm-smoke-pss/main.go b/cmd/swarm/swarm-smoke-pss/main.go index 16143a22be..edb25b4228 100644 --- a/cmd/swarm/swarm-smoke-pss/main.go +++ b/cmd/swarm/swarm-smoke-pss/main.go @@ -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) } diff --git a/cmd/swarm/swarm-smoke-pss/pss.go b/cmd/swarm/swarm-smoke-pss/pss.go index ed0eda6932..59fc54ac5e 100644 --- a/cmd/swarm/swarm-smoke-pss/pss.go +++ b/cmd/swarm/swarm-smoke-pss/pss.go @@ -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