malkemit / namizun

Asymmetric upload and download
https://t.me/ExplainLikeIam5
613 stars 99 forks source link

Bug:network io traffic count logic is error. #59

Closed shadu120 closed 1 year ago

shadu120 commented 1 year ago

My server has:

tun0 and wg0 is runing one eth0.

Current logic:

def get_network_io():
    io = net_io_counters()
    return io.bytes_sent + database.get_parameter('upload_amount_synchronizer') \
        , io.bytes_recv + database.get_parameter('download_amount_synchronizer')

This script count all the traffic of Ethernets, but not a specific one, such as "eth0". Namizun should allow user to customize which physic networks shoud be counted in list.

An option logic Current logic:

def get_network_io():
    io = net_io_counters(pernic=True)['eth0']
    return io.bytes_sent + database.get_parameter('upload_amount_synchronizer') \
        , io.bytes_recv + database.get_parameter('download_amount_synchronizer')
malkemit commented 1 year ago

Hello I will rewrite the script again and create a new scenario that includes Docker

For this issue, I will do something that will not be a problem