I wanted to understand the data I send and receive when I connect to a router.
Like most people, I’ve used Speedtest by Ookla. As you know the result contains just basic information about your internet connection. But luckily they have a CLI, providing much more data.
When I ran ‘speedtest’ for the first time in my terminal, I thought I must do a project with all the generated data.
That’s how I ended up making WebSpeedReport.
WebspeedReport in a nutshell
WebSpeedReport is an open-source software that wraps the command of Speedtest CLI, stores your data, and then displays them in a nice clean format.
The structure of the project
The project has two very distinct parts:
- Get the data and store them in a database.
- Depict the data to a localhost page.
For the first part, I would use Symfony to get the generated data from Speedtest’s CLI and MySQL to store them.
As for the second part I use PHP for the backend and TailwindCSS for manipulating the DOM.
Playing with Symfony PHP
I wanted to build something with Symfony, but I had no idea where to start.
After watching a course about the console package it seemed the perfect fit (I tried my best to forget about Python when I wrote this sentence). I made a speedtestCommand class that extends the Command class of Symfony, to handle the first part of the project. Within that class, there is an execute() function that does all the work.
From executing the Speedtest command to storing the JSON files and creating the corresponding database to save the results of the speed test.
I am currently reading more about the console package and the way I can utilize its capabilities to make the code cleaner.
Depicting the data
The second part it’s the most important because it has to adequately answer the question:
“How can I display the data as efficiently as possible?”.
For the first version, I wanted to make things as simple as possible. That’s why for the time being you’ll find a dashboard with the most basic information and underneath it, a table containing all the speedtest runs you performed.
If you want to load more information about each run, you can click on “Load More” and see all the details of that specific speed test.
An issue I am working on
As of this writing, to generate the data you have to manually run:
cd WebSpeedReport
./webspeedreport app:speedtest
But if you go inside the execute() function you’ll notice code for making your own cron jobs.
I am currently testing the crons I’ve set up on my laptop and very soon you will be able to set your own through the command line:
cd WebSpeedReport
./webspeedreport app:speedtest daily 11:00,14:00,19:00
Contributing
WebSpeedReport is my first open-source project.
Having said that I’ll be more than happy to have some contributions and ideas on how I can make it better.
So If you have an idea about a new feature or a part of code that can be better, you are more than welcome to share them within the GitHub repository.
Top comments (1)
Nice one and welcome to the community!