vergoh / vnstat

vnStat - a network traffic monitor for Linux and BSD
GNU General Public License v2.0
1.46k stars 123 forks source link

What are the correct unit used to display rx/tx value on v2.10 vs v1.15 for some specific commands? #271

Closed guruhackcio closed 1 day ago

guruhackcio commented 3 days ago

Hi, I have two different Raspberry pi environment.

One is using the vnstat 2.10 with "vnstat -i --json d 30" command and Another is using the vnstat 1.15 with "vnstat -i --json d" command

Both are connected to the same ssid through a wlan0 interface and are used for development.

There are not much activity going on with 2.10 one but upon executing the command, the returned total numbers of rx/tx with 1x1^10 digits of numbers whereas the 1.15 one returns 1x10^7 digits total data which is much smaller although there are more activity happening.

Is there any option to present which unit is being used by both "vnstat -i --json d 30" in 2.10 and "vnstat -i --json d" in 1.15 to display the traffic rx/tx ?

so that I could determine whether my data consumptions is actually high or it's just simple calculation mistake and adjust my calculation formula to present my data accordingly on each environment?

I noticed some fixes and improvements have been added between those two versions from the changelog. Any possibility that it changes how the rx/tx unit is displayed as well?

vergoh commented 2 days ago

The man pages of both releases document the output format:

--json in version 1.15:

All traffic values in the output are in KiB.

--json in version 2.10:

All traffic values in the output are in bytes.

This is also the reason why the json structure isn't the same between 1.x and 2.x versions so that there's no misunderstanding why things stop making sense after the upgrade if the output is forwarded to so other tools which doesn't evaluate the jsonversion field.

guruhackcio commented 1 day ago

Understood, I'll use this information accordingly. Thanks!