Ping Modeller is a useful tool which allows the user to test the strength of their internet connection to any defined host, for any purpose
required. For example, to be able to participate fully in any online multiplayer game, the user's connection needs to be of a certain strength
to avoid lag-related issues; this short script allows the user to check how strong their connection will be beforehand, avoiding frustration
upon discovery in-game. It also gives the user an idea of how easily they will be able to connect to a streaming website for example, provided
they understand how “ping” is relevant to their connection.
Essenstially, the measure of the connection can be gathered by “pinging” a host URL, which means sending arbitrary data packets to
it, measuring the time between their departure and return in milliseconds. The user ideally wants this to be as low as possible, as 0ms would
theoretically be an instantaneous connection.
This script allows the user to input a host URL (in the left example, google.com)along with a time
interval over which to ping the host, after which it returns a graph of the varying ping time (in ms) against the time interval, along with
plotted lines signifying the mean average ping and one standard deviation.
A check is included by means of if statement, wherein if, after a quarter of the alotted time has passed (or 10 seconds, which ever is shorter) and no packets have returned (i.e. the ping array is filled with None values), the loop breaks and the user is asked if the input host address is correct. This is likely to be the error, unless the connection is so slow that the packets do not return.