the subscriber will wait longer to maximise the reception

This commit is contained in:
0xFugue 2023-01-20 20:21:02 +05:30
parent b5de96eb5c
commit 0efc295863
5 changed files with 26 additions and 18 deletions

View File

@ -24,7 +24,7 @@ loglvl="info" # log level
duration=$2 duration=$2
#iat=$3 #iat=$3
sleep_time=30 sleep_time=20
time="" time=""
unique="XYZ" unique="XYZ"
@ -119,18 +119,6 @@ docker_run() {
#darg= "--network=host" #darg= "--network=host"
[ -d $LPDIR ] || mkdir -p $LPDIR
ofname="$LPDIR/$lpush.out"
echo "docker: stopping and removing $prefix-$lpush"
docker stop $prefix-$lpush
docker rm $prefix-$lpush
echo "docker: starting $prefix-$lpush"
echo " docker run --name "$prefix-$lpush" -d=true "$prefix-$lpush:alpha" -o "$docker_op_dir/$lpush.out" -d $duration -i $iat -l $loglvl -c $ctopic"
docker run --name "$prefix-$lpush" -d=true "$prefix-$lpush:alpha" -o "$docker_op_dir/$lpush.out" -d $duration -i $iat -l $loglvl -c $ctopic
#sleep $sleep_time
[ -d $FTDIR ] || mkdir -p $FTDIR [ -d $FTDIR ] || mkdir -p $FTDIR
ofname="$FTDIR/$filtr.out" ofname="$FTDIR/$filtr.out"
echo "docker: stopping and removing $prefix-$filtr" echo "docker: stopping and removing $prefix-$filtr"
@ -141,6 +129,17 @@ docker_run() {
docker run --name "$prefix-$filtr" -d=true "$prefix-$filtr:alpha" -o "$docker_op_dir/$filtr.out" -d $duration -l $loglvl -i $iat -c $ctopic docker run --name "$prefix-$filtr" -d=true "$prefix-$filtr:alpha" -o "$docker_op_dir/$filtr.out" -d $duration -l $loglvl -i $iat -c $ctopic
echo "$prefix-$filtr is running as $prefix-$filtr" echo "$prefix-$filtr is running as $prefix-$filtr"
sleep $sleep_time
[ -d $LPDIR ] || mkdir -p $LPDIR
ofname="$LPDIR/$lpush.out"
echo "docker: stopping and removing $prefix-$lpush"
docker stop $prefix-$lpush
docker rm $prefix-$lpush
echo "docker: starting $prefix-$lpush"
echo " docker run --name "$prefix-$lpush" -d=true "$prefix-$lpush:alpha" -o "$docker_op_dir/$lpush.out" -d $duration -i $iat -l $loglvl -c $ctopic"
docker run --name "$prefix-$lpush" -d=true "$prefix-$lpush:alpha" -o "$docker_op_dir/$lpush.out" -d $duration -i $iat -l $loglvl -c $ctopic
# now wait for runs to complete... # now wait for runs to complete...
echo "$(date): Waiting for the docker run to finish in $duration" echo "$(date): Waiting for the docker run to finish in $duration"
@ -183,7 +182,9 @@ kurtosis_run() {
}" > waku/config.json }" > waku/config.json
kurtosis run --enclave-id $enclave . '{"config":"github.com/logos-co/wadoku/waku/config.json"}' > $FTDIR/kurtosis_output.log kurtosis run --enclave-id $enclave . '{"config":"github.com/logos-co/wadoku/waku/config.json"}' > $FTDIR/kurtosis_output.log
sleep $sleep_time sleep $sleep_time
filtr_suffix="$(kurtosis enclave inspect $enclave | grep $prefix-$filtr | cut -f 1 -d ' ')" filtr_suffix="$(kurtosis enclave inspect $enclave | grep $prefix-$filtr | cut -f 1 -d ' ')"
lpush_suffix="$(kurtosis enclave inspect $enclave | grep $prefix-$lpush | cut -f 1 -d ' ')" lpush_suffix="$(kurtosis enclave inspect $enclave | grep $prefix-$lpush | cut -f 1 -d ' ')"

View File

@ -9,6 +9,8 @@ import (
const StartPort = 60000 const StartPort = 60000
const PortRange = 1000 const PortRange = 1000
const GraceWait = 10 // percentage
const InterPubSubDelay = 25 // seconds
const DnsDiscoveryUrl = "enrtree://AOGECG2SPND25EEFMAJ5WF3KSGJNSGV356DSTL2YVLLZWIV6SAYBM@prod.waku.nodes.status.im" const DnsDiscoveryUrl = "enrtree://AOGECG2SPND25EEFMAJ5WF3KSGJNSGV356DSTL2YVLLZWIV6SAYBM@prod.waku.nodes.status.im"
const NameServer = "1.1.1.1" const NameServer = "1.1.1.1"
const LocalHost = "0.0.0.0" const LocalHost = "0.0.0.0"

View File

@ -1,8 +1,8 @@
{ {
"output_file": "output.out", "output_file": "output.out",
"duration": "2000s", "duration": "1024s",
"iat": "100ms", "iat": "100ms",
"content_topic": "2000s-100ms-2023-01-18-14h33m38s-XYZ", "content_topic": "1024s-100ms-2023-01-20-16h01m32s-XYZ",
"log_level": "info", "log_level": "info",
"log_file": "output.log" "log_file": "output.log"
} }

View File

@ -145,8 +145,13 @@ func main() {
log.Error("Out of the Write loop: Message channel closed - timeout") log.Error("Out of the Write loop: Message channel closed - timeout")
stopC <- struct{}{} stopC <- struct{}{}
}() }()
// add extra 20sec + 5% as a grace period to receive as much as possible
filterWait := conf.Duration +
common.InterPubSubDelay * time.Second +
conf.Duration/100*common.GraceWait
<-time.After(conf.Duration) log.Info("Will be waiting for ", filterWait, ", excess ", common.GraceWait, "% from ", conf.Duration)
<-time.After(filterWait)
log.Error(conf.Duration, " elapsed, closing the " + nodeType + " node!"); log.Error(conf.Duration, " elapsed, closing the " + nodeType + " node!");
// shut the nodes down // shut the nodes down

View File

@ -63,7 +63,7 @@ func main() {
node.WithHostAddress(hostAddr), node.WithHostAddress(hostAddr),
//node.WithNTP(), // don't use NTP, fails at msec granularity //node.WithNTP(), // don't use NTP, fails at msec granularity
node.WithWakuRelay(), node.WithWakuRelay(),
node.WithLightPush(), //node.WithLightPush(), // no need to add lightpush to be a lightpush client!
) )
if err != nil { if err != nil {
panic(err) panic(err)