Mercurial > stress-tester
changeset 1288:ded8813add01
UnidirectionalRawPacketWorker - metric.updateSentByte
author | Devel 1 |
---|---|
date | Tue, 14 Jul 2020 14:13:00 +0200 |
parents | c04b5c168a9c |
children | 7d538c69a6e1 |
files | stress-tester/src/main/java/com/passus/st/emitter/raw/DpdkUnidirectionalRawPacketWorker.java stress-tester/src/main/java/com/passus/st/emitter/raw/PcapUnidirectionalRawPacketWorker.java |
diffstat | 2 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/emitter/raw/DpdkUnidirectionalRawPacketWorker.java Fri Jul 10 13:44:01 2020 +0200 +++ b/stress-tester/src/main/java/com/passus/st/emitter/raw/DpdkUnidirectionalRawPacketWorker.java Tue Jul 14 14:13:00 2020 +0200 @@ -187,6 +187,11 @@ throw new IOException("Unable to send packet. DPDK error."); } } + if (collectMetrics) { + synchronized (metric) { + metric.updateSentBytes(length); + } + } return length; }
--- a/stress-tester/src/main/java/com/passus/st/emitter/raw/PcapUnidirectionalRawPacketWorker.java Fri Jul 10 13:44:01 2020 +0200 +++ b/stress-tester/src/main/java/com/passus/st/emitter/raw/PcapUnidirectionalRawPacketWorker.java Tue Jul 14 14:13:00 2020 +0200 @@ -47,7 +47,6 @@ } } - return ifc.getName(); } @@ -89,6 +88,11 @@ if (res != 0) { throw new IOException("Unable to send packet. Pcap error: " + pcap.pcap().getErr()); } + if (collectMetrics) { + synchronized (metric) { + metric.updateSentBytes(length); + } + } return length; } @@ -117,5 +121,4 @@ } } - }