forked from ipspace/netlab-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
timing: a script to measure device boot/config times
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Measure Virtual Device Startup Time | ||
|
||
The script in this directory was used to measure the time it takes to boot a network device and perform the minimal initial configuration. | ||
|
||
If you want to repeat the measurements: | ||
|
||
* [Install netlab](https://netsim-tools.readthedocs.io/en/latest/install.html) | ||
* [Build Vagrant boxes](https://netsim-tools.readthedocs.io/en/latest/labs/libvirt.html) for the networking devices you want to test | ||
* Execute `./timing.sh <list-of-devices>` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
# | ||
# Time how long it takes to spin up a virtual machine and do initial configuration | ||
# | ||
set -e | ||
if [ -z "$1" ]; then | ||
echo "Specify device type" | ||
exit 1 | ||
fi | ||
for dut in $@; do | ||
echo "Device: $dut" | ||
netlab create -d $dut >/dev/null 2>/dev/null | ||
echo -n "Starting the lab: " | ||
/usr/bin/time -f "%E" bash -c 'netlab up --snapshot --no-config >/dev/null 2>/dev/null || echo "netlab up failed"' | ||
echo -n "Device configuration: " | ||
/usr/bin/time -f "%E" bash -c 'netlab initial >/dev/null 2>/dev/null || echo "netlab up failed"' | ||
netlab down --cleanup >/dev/null 2>/dev/null | ||
echo "... done" | ||
echo "" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# Lab topology used to test VM start times | ||
# | ||
nodes: [ dut ] | ||
|
||
links: | ||
- dut |