Monitor any latency for running ping command.
You can download Python 3 from the Python Official Website and install it on your computer.
If you are a Linux user, you can install Tmux for managing multi-session terminals in the background. This will allow you to run a Python web server and execute the ping command simultaneously.
sudo apt-get install tmux
- Open your terminal, clone this project into your computer.
- Change directory to 'python-web-latency-monitoring'
git clone https://github.com/haikal-dev/python-web-latency-monitoring.git
cd python-web-latency-monitoring
This will allow you to run a Python web server. In your project directory, open the terminal and type the following command:
pip install Flask
You can run two commands in the background using Tmux. To do this, open the terminal in your project directory and type the following command:
tmux new -d -s ping 'ping 8.8.8.8 > ping.txt'
tmux new -d -s server 'python3 app.py'
Open your browser, simply type URL:
http://localhost:5000
Open two command prompts separately. In each command prompt, navigate to your project directory.
cd <project-directory-path>
On first command prompt, run ping command.
ping 8.8.8.8 > ping.txt
On second command prompt, run python web server.
python3 app.py
While both terminals are running, you can open the browser and type the URL:
http://localhost:5000
You can also press 'F' for full screen.