mirror of
https://github.com/status-im/libp2p-test-plans.git
synced 2025-01-13 16:24:15 +00:00
Add 'outbound only' parameter
This commit is contained in:
parent
2305d9e08e
commit
b51d7c832c
@ -32,6 +32,7 @@ testground(client):
|
|||||||
.withRng(rng)
|
.withRng(rng)
|
||||||
#.withYamux()
|
#.withYamux()
|
||||||
.withMplex()
|
.withMplex()
|
||||||
|
.withMaxConnections(10000)
|
||||||
.withTcpTransport(flags = {ServerFlags.TcpNoDelay})
|
.withTcpTransport(flags = {ServerFlags.TcpNoDelay})
|
||||||
#.withPlainText()
|
#.withPlainText()
|
||||||
.withNoise()
|
.withNoise()
|
||||||
@ -97,6 +98,8 @@ testground(client):
|
|||||||
while peersInfo.len < client.testInstanceCount:
|
while peersInfo.len < client.testInstanceCount:
|
||||||
peersInfo.add(await peersTopic.popFirst())
|
peersInfo.add(await peersTopic.popFirst())
|
||||||
|
|
||||||
|
peersInfo = peersInfo[client.param(int, "outbound_only") .. ^1]
|
||||||
|
|
||||||
rng.shuffle(peersInfo)
|
rng.shuffle(peersInfo)
|
||||||
|
|
||||||
let connectTo = client.param(int, "connection_count")
|
let connectTo = client.param(int, "connection_count")
|
||||||
@ -109,7 +112,7 @@ testground(client):
|
|||||||
peerId = PeerId.init(peerInfo.id).tryGet()
|
peerId = PeerId.init(peerInfo.id).tryGet()
|
||||||
addrs = peerInfo.addrs.mapIt(MultiAddress.init(it).tryGet())
|
addrs = peerInfo.addrs.mapIt(MultiAddress.init(it).tryGet())
|
||||||
try:
|
try:
|
||||||
await switch.connect(peerId, addrs)
|
await switch.connect(peerId, addrs).wait(5.seconds)
|
||||||
connected.inc()
|
connected.inc()
|
||||||
except CatchableError as exc:
|
except CatchableError as exc:
|
||||||
echo "Failed to dial", exc.msg
|
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 }
|
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 }
|
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 }
|
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 strutils
|
||||||
import ggplotnim
|
import ggplotnim
|
||||||
|
|
||||||
@ -36,10 +37,15 @@ let
|
|||||||
|
|
||||||
df = df.filter(f{`time` < maxTime - 3}).mutate(f{"scaled_amount" ~ `amount` * factor})
|
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})
|
let sa = secAxis(name = "Reception count", trans = f{1.0 / factor})
|
||||||
ggplot(df, aes("time", "maxLatencies")) +
|
ggplot(df, aes("time", "maxLatencies")) +
|
||||||
geom_line(aes("time", y = "scaled_amount", color = "Amount")) +
|
geom_line(aes("time", y = "scaled_amount", color = "Amount")) +
|
||||||
ylim(0, maxLatency) +
|
ylim(0, maxLatency) +
|
||||||
|
ggtitle(paramStr(1)) +
|
||||||
legendPosition(0.8, -0.2) +
|
legendPosition(0.8, -0.2) +
|
||||||
scale_y_continuous(name = "Latency (ms)", secAxis = sa) +
|
scale_y_continuous(name = "Latency (ms)", secAxis = sa) +
|
||||||
geom_line(aes("time", y = "maxLatencies", color = "Max")) +
|
geom_line(aes("time", y = "maxLatencies", color = "Max")) +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user