From: Thierry Parmentelat Date: Wed, 3 Oct 2012 16:29:49 +0000 (+0200) Subject: retrieve individual stats with ovs-vsctl instead of parsing the whole line X-Git-Tag: sliver-openvswitch-1.8.90-5~22^2~1 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=2a22b514cc33c0352b9b1f0f77e3b18b08e325c2 retrieve individual stats with ovs-vsctl instead of parsing the whole line --- diff --git a/planetlab/scripts/sliver-ovs.in b/planetlab/scripts/sliver-ovs.in index 2a95797ad..9af130e10 100755 --- a/planetlab/scripts/sliver-ovs.in +++ b/planetlab/scripts/sliver-ovs.in @@ -271,9 +271,8 @@ function gmap_report_once () { iface=$1; shift hostname=$1; shift linkid=$1; shift - report=$(ovs-vsctl get interface $iface statistics) - rx_bytes=$(echo $report | sed -e 's/^.*rx_bytes=//' -e 's/,.*$//') - tx_bytes=$(echo $report | sed -e 's/^.*tx_bytes=//' -e 's/,.*$//') + rx_bytes=$(ovs-vsctl get interface $iface statistics:rx_bytes) + tx_bytes=$(ovs-vsctl get interface $iface statistics:tx_bytes) rx_bits=$(($rx_bytes*8)) tx_bits=$(($tx_bytes*8)) now=$(date +%s).$(date +%N)