I use
PerfGraph for something similar.
I have two instances which ping my router and google and report the ping of each, also, there is color coding for late and very late packets.
So if all is well, teh graph is Green, and I use Orange and Red to show about packets late or dropped.
That way I know if the issue is at my end or my ISPs.
Also helps in troubleshooting when the internet is not disconnected, but slow.
This is how it looks.
DONE: Icon in system tray to show when there in no internet connection