Add 'outbound only' parameter
This commit is contained in:
parent
2305d9e08e
commit
b51d7c832c
|
@ -32,6 +32,7 @@ testground(client):
|
|||
.withRng(rng)
|
||||
#.withYamux()
|
||||
.withMplex()
|
||||
.withMaxConnections(10000)
|
||||
.withTcpTransport(flags = {ServerFlags.TcpNoDelay})
|
||||
#.withPlainText()
|
||||
.withNoise()
|
||||
|
@ -97,6 +98,8 @@ testground(client):
|
|||
while peersInfo.len < client.testInstanceCount:
|
||||
peersInfo.add(await peersTopic.popFirst())
|
||||
|
||||
peersInfo = peersInfo[client.param(int, "outbound_only") .. ^1]
|
||||
|
||||
rng.shuffle(peersInfo)
|
||||
|
||||
let connectTo = client.param(int, "connection_count")
|
||||
|
@ -109,7 +112,7 @@ testground(client):
|
|||
peerId = PeerId.init(peerInfo.id).tryGet()
|
||||
addrs = peerInfo.addrs.mapIt(MultiAddress.init(it).tryGet())
|
||||
try:
|
||||
await switch.connect(peerId, addrs)
|
||||
await switch.connect(peerId, addrs).wait(5.seconds)
|
||||
connected.inc()
|
||||
except CatchableError as exc:
|
||||
echo "Failed to dial", exc.msg
|
||||
|
|
|
@ -22,3 +22,4 @@ instances = { min = 2, max = 100000, default = 20 }
|
|||
message_count = { type = "int", desc = "number of messages to send per publisher", unit = "msg", default = 20 }
|
||||
warmup_messages = { type = "int", desc = "empty messages to send before test", unit = "msg", default = 10 }
|
||||
max_message_delay = { type = "int", desc = "max delay between messages per publisher", unit = "ms", default = 500 }
|
||||
outbound_only = { type = "int", desc = "number of nodes without incoming connections", unit = "nodes", default = 0 }
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import os
|
||||
import strutils
|
||||
import ggplotnim
|
||||
|
||||
|
@ -36,10 +37,15 @@ let
|
|||
|
||||
df = df.filter(f{`time` < maxTime - 3}).mutate(f{"scaled_amount" ~ `amount` * factor})
|
||||
|
||||
echo "Average max latency: ", df["maxLatencies", int].mean
|
||||
echo "Average received count: ", df["amount", int].mean
|
||||
echo "Minimum received count: ", df["amount", int].min
|
||||
|
||||
let sa = secAxis(name = "Reception count", trans = f{1.0 / factor})
|
||||
ggplot(df, aes("time", "maxLatencies")) +
|
||||
geom_line(aes("time", y = "scaled_amount", color = "Amount")) +
|
||||
ylim(0, maxLatency) +
|
||||
ggtitle(paramStr(1)) +
|
||||
legendPosition(0.8, -0.2) +
|
||||
scale_y_continuous(name = "Latency (ms)", secAxis = sa) +
|
||||
geom_line(aes("time", y = "maxLatencies", color = "Max")) +
|
||||
|
|
Loading…
Reference in New Issue