

def rx_tx_dump(interface):
    for line in open('/proc/net/dev'):
        if (interface in line):
            data = line.split(('%s:' % interface))[1].split()
            (rx, tx) = ([int(x) for x in data[0:8]], [int(x) for x in data[8:]])
    return (rx, tx)

dataset/ETHPy150Open cgoldberg/linux-metrics/linux_metrics/net_stat.py rx_tx_dump/original