Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
212933a4af |
@@ -8,13 +8,14 @@
|
||||
```sh
|
||||
nimble install -dy
|
||||
cd shadow
|
||||
./run.sh x n
|
||||
# The run.sh file runs the simulation "x" number of times and every simulation run uses "n" number of nodes
|
||||
# The number of nodes is maintained in the shadow.yaml file, and automatically updated by run.sh.
|
||||
# The output files latencies(x), stats(x) and shadowlog(x) carries the outputs for each simulation run.
|
||||
# The summary_dontwant.awk, summary_latency.awk, and summary_shadowlog.awk parse the output files.
|
||||
# The run.sh script automatically calls these files to display the output
|
||||
# a temperary data.shadow folder is created for each simulation and removed by the run.sh after the simulation is over
|
||||
# the default shadow.yml will start 5k nodes, you might want to change that by removing
|
||||
# lines and setting PEERS to the number of instances
|
||||
./run.sh <runs> <nodes>
|
||||
# the first parameter <runs> tells the number of simulation runs, and second parameter <nodes> tells the
|
||||
# number of nodes in simulation, for example ./run.sh 2 3000
|
||||
# the output for each run creates latencies(X) and shadowlogX files. where X is the simulation number.
|
||||
|
||||
# the run script (run.sh) uses awk to summarize latencies(X) and shadowlogX files
|
||||
|
||||
# you can use the plotter tool to extract useful metrics & generate a graph
|
||||
cd ../tools
|
||||
|
||||
+3
-10
@@ -1,6 +1,6 @@
|
||||
import stew/endians2, stew/byteutils, tables, strutils, os
|
||||
import ../../nim-libp2p/libp2p, ../../nim-libp2p/libp2p/protocols/pubsub/rpc/messages
|
||||
import ../../nim-libp2p/libp2p/muxers/mplex/lpchannel, ../../nim-libp2p/libp2p/protocols/ping
|
||||
import libp2p, libp2p/protocols/pubsub/rpc/messages
|
||||
import libp2p/muxers/mplex/lpchannel, libp2p/protocols/ping
|
||||
import chronos
|
||||
import sequtils, hashes, math, metrics
|
||||
from times import getTime, toUnix, fromUnix, `-`, initTime, `$`, inMilliseconds
|
||||
@@ -156,12 +156,5 @@ proc main {.async.} =
|
||||
|
||||
#echo "BW: ", libp2p_protocols_bytes.value(labelValues=["/meshsub/1.1.0", "in"]) + libp2p_protocols_bytes.value(labelValues=["/meshsub/1.1.0", "out"])
|
||||
#echo "DUPS: ", libp2p_gossipsub_duplicate.value(), " / ", libp2p_gossipsub_received.value()
|
||||
#requires exporting counters from GossipSub.nim
|
||||
echo "statcounters: dup_during_validation ", libp2p_gossipsub_duplicate_during_validation.value(),
|
||||
"\tidontwant_saves ", libp2p_gossipsub_idontwant_saved_messages.value(),
|
||||
#"gossip optimization saves ", libp2p_gossipsub_saved_bytes.value(),
|
||||
"\tdup_received ", libp2p_gossipsub_duplicate.value(),
|
||||
"\tUnique_msg_received ", libp2p_gossipsub_received.value(),
|
||||
"\tStaggered_Saves ", libp2p_gossipsub_staggerSave.value(),
|
||||
"\tDontWant_IN_Stagger ", libp2p_gossipsub_staggerDontWantSave.value()
|
||||
|
||||
waitFor(main())
|
||||
|
||||
+2
-5
@@ -17,14 +17,12 @@ while [ $counter -le $nodes ]; do
|
||||
counter=$((counter + 1))
|
||||
done
|
||||
|
||||
rm -f shadowlog* latencies* stats* main && rm -rf shadow.data/
|
||||
rm -f shadowlog* latencies* main && rm -rf shadow.data/
|
||||
nim c -d:chronicles_colors=None --threads:on -d:metrics -d:libp2p_network_protocols_metrics -d:release main
|
||||
|
||||
for i in $(seq $runs); do
|
||||
echo "Running for turn "$i
|
||||
shadow shadow.yaml > shadowlog$i &&
|
||||
grep -rne 'milliseconds\|BW' shadow.data/ > latencies$i &&
|
||||
grep -rne 'statcounters:' shadow.data/ > stats$i
|
||||
shadow shadow.yaml > shadowlog$i && grep -rne 'milliseconds\|BW' shadow.data/ > latencies$i
|
||||
rm -rf shadow.data/
|
||||
done
|
||||
|
||||
@@ -32,5 +30,4 @@ for i in $(seq $runs); do
|
||||
echo "Summary for turn "$i
|
||||
awk -f summary_latency.awk latencies$i
|
||||
awk -f summary_shadowlog.awk shadowlog$i
|
||||
awk -f summary_dontwant.awk stats$i
|
||||
done
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
BEGIN {
|
||||
FS = " "; #default column separator
|
||||
idontwant_saves = min_idontwant = max_idontwant = 0;
|
||||
dup_received = min_dup = max_dup = 0;
|
||||
unique_msg_received = 0;
|
||||
stagger_saves = 0;
|
||||
stagger_DontWantSaves = 0;
|
||||
}
|
||||
|
||||
{
|
||||
#print $5, $7, $9
|
||||
idontwant_saves += $5
|
||||
if ($5 < min_idontwant || min_idontwant == 0) min_idontwant = $5
|
||||
if ($5 > max_idontwant) max_idontwant = $5
|
||||
|
||||
dup_received += $7
|
||||
if ($7 < min_dup || min_dup == 0) min_dup = $7
|
||||
if ($7 > max_dup) max_dup = $7
|
||||
|
||||
unique_msg_received += $9
|
||||
stagger_saves += $11
|
||||
stagger_DontWantSaves += $13
|
||||
|
||||
}
|
||||
|
||||
END {
|
||||
print "idontwant_saves min, max, avg, total : ", min_idontwant, "\t", max_idontwant, "\t", idontwant_saves/NR, "\t", idontwant_saves
|
||||
print "dup_received min, max, avg, total : ", min_dup, "\t", max_dup, "\t", dup_received/NR, "\t", dup_received
|
||||
print "Unique_msg_received: ", unique_msg_received, "\tStagger Saves : ", stagger_saves, "\tStaggerDontWantSaves", stagger_DontWantSaves
|
||||
}
|
||||
Reference in New Issue
Block a user