

def net_stats_ifconfig(interface):
    output = subprocess.Popen(['ifconfig', interface], stdout=subprocess.PIPE).communicate()[0]
    rx_bytes = int(re.findall('RX bytes:([0-9]*) ', output)[0])
    tx_bytes = int(re.findall('TX bytes:([0-9]*) ', output)[0])
    return (rx_bytes, tx_bytes)

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