6
submitted 1 year ago* (last edited 1 year ago) by Subject6051@lemmy.ml to c/linux@lemmy.ml

[SOLVED kinda]

I now know the cause of this. I have scrcpy, syncthing and KDE connect working in the background. So, if I upload something from one device to another, it gets treated as upload using data bandwidth and it gets counted, even if I am not uploading it to the internet.


vnstat won't show me accurate data, it's estimates for today are 1.66 times greater than what it should be. If the data usage is 6 GB, it would show me that it is 10GB, pretty inaccurate readings. Is there a way to fix this? Also, sometimes it's 1.66 times and sometimes it more/less. It isn't accurate is my point.

PS: I need it to be vnstat as I have a script which works on vnstat

But, if there is another better package, do tell me about it.

here is the script, (strictly not relevant)

#!/bin/bash
eleven=$(vnstat --json | jq --arg day "$(date +'%d')" --arg month "$(date +'%m')" '.interfaces[0].traffic.day[] | select(.date.day == ($day | tonumber) and .date.month == ($month | tonumber)) | (.rx + .tx)/ (1024*1024*1024)')
rounded_eleven=$(printf "%.2f" "$eleven")

echo " $rounded_eleven GB"

What are you comparing it to? I’m pretty sure vnstat is using the raw.interface counters. This would include all protocol overhead. I would expect it to be higher than, for example, an application level counter.

___

you are viewing a single comment's thread
view the rest of the comments
[-] Subject6051@lemmy.ml 1 points 1 year ago

I now know the cause of this. I have scrcpy, syncthing and KDE connect working in the background. So, if I upload something from one device to another, it gets treated as upload using data bandwidth and it gets counted, even if I am not uploading it to the internet.

The comparison is fair, but I thought vnstat only measured data bandwidth (i.e., which is used over the internet) but it's counting file sharing too. So, the measurements are haywire.

this post was submitted on 19 Sep 2023
6 points (87.5% liked)

Linux

48210 readers
715 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS