Add network test command

This commit is contained in:
Ben Adrian Sarmiento
2024-06-16 09:47:29 +02:00
parent f4d3f273f6
commit 42a08583ce
7 changed files with 60 additions and 47 deletions

View File

@@ -53,12 +53,15 @@ func (r *IPRepository) NetworkTest(forceRun bool) {
}
if ipv4Loaded && ipv6Loaded {
return
} else {
r.log.Warn("Network test files not found")
}
}
r.log.Info("Network test will start now (this will only run once). IGNORE THE WARNINGS!")
r.log.Info("Network test will start now. IGNORE THE WARNINGS!")
r.runLatencyTest()
r.log.Infof("Network test completed. Saving the results to %s and %s", ipv4latencyFile, ipv6latencyFile)
r.log.Info("Network test completed!")
r.log.Infof("To rerun the network test, run 'zurg network-test', or delete the files %s and %s and run zurg again", ipv4latencyFile, ipv6latencyFile)
r.writeLatencyFile(ipv4latencyFile, r.ipv4latencyMap)
r.writeLatencyFile(ipv6latencyFile, r.ipv6latencyMap)
}