Jean-Tinland / simple-bar

A yabai status bar widget for Übersicht
https://www.jeantinland.com/toolbox/simple-bar
MIT License
1.19k stars 130 forks source link

Netstat widget is inaccurate #376

Closed jacobg-jellyfish closed 9 months ago

jacobg-jellyfish commented 9 months ago

The Netstat script which provides the data for the network up/down widget is inaccurate.

Whilst doing speedtests, the reported speed of the widget was less than half of what was reported by speedtest.

Additionally whilst the widget is running - I output the contents of the /tmp/netstats.out file and noticed that the row with the actual number of bytes would be empty.

Screenshot 2023-12-05 at 15 46 25

Screenshot 2023-12-05 at 15 46 10

Jean-Tinland commented 9 months ago

The simple-bar network stats widget utilizes the output of the netstat command and converts the bytes into a readable format.

Although I am not entirely familiar with its inner workings, it appears that the internet speed test does not directly use the displayed amount of data. Instead, it estimates your network's maximum capacity.

To observe this behavior, you can run the following command to display the network activity for all your opened apps:

nettop -P -k state,interface -d

Upon inspecting the row corresponding to your web browser and initiating an internet speed test, you should see that the same data is displayed in the simple-bar netstats widget.

Correct me if I'm wrong but I don't think there is any problem with the netstats widget. :)

jacobg-jellyfish commented 9 months ago

@Jean-Tinland Thank you for that explanation. I double checked things using that logic and thats cleared things up nicely.