changeset 1291:610c12a93ee7

UnidirectionalRawPacketWorker - thread name
author Devel 1
date Tue, 14 Jul 2020 16:53:23 +0200
parents b8dcd14f0c95
children 78e67587e149
files stress-tester/src/main/java/com/passus/st/emitter/raw/DpdkUnidirectionalRawPacketEmitter.java stress-tester/src/main/java/com/passus/st/emitter/raw/DpdkUnidirectionalRawPacketWorker.java stress-tester/src/main/java/com/passus/st/emitter/raw/PcapUnidirectionalRawPacketEmitter.java stress-tester/src/main/java/com/passus/st/emitter/raw/PcapUnidirectionalRawPacketWorker.java stress-tester/src/main/java/com/passus/st/emitter/raw/UnidirectionalRawPacketEmitter.java stress-tester/src/main/java/com/passus/st/emitter/raw/UnidirectionalRawPacketWorker.java stress-tester/src/test/java/com/passus/st/emitter/raw/PcapUnidirectionalRawPacketWorkerTest.java
diffstat 7 files changed, 19 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/emitter/raw/DpdkUnidirectionalRawPacketEmitter.java	Tue Jul 14 16:00:05 2020 +0200
+++ b/stress-tester/src/main/java/com/passus/st/emitter/raw/DpdkUnidirectionalRawPacketEmitter.java	Tue Jul 14 16:53:23 2020 +0200
@@ -39,8 +39,8 @@
     }
 
     @Override
-    protected UnidirectionalRawPacketWorker<DpdkAO> createWorker() {
-        DpdkUnidirectionalRawPacketWorker worker = new DpdkUnidirectionalRawPacketWorker();
+    protected UnidirectionalRawPacketWorker<DpdkAO> createWorker(int index) {
+        DpdkUnidirectionalRawPacketWorker worker = new DpdkUnidirectionalRawPacketWorker(index);
         worker.setBufferSize(bufferSize);
         worker.setBufferFlushPeriod(bufferFlushPeriod);
         return worker;
--- a/stress-tester/src/main/java/com/passus/st/emitter/raw/DpdkUnidirectionalRawPacketWorker.java	Tue Jul 14 16:00:05 2020 +0200
+++ b/stress-tester/src/main/java/com/passus/st/emitter/raw/DpdkUnidirectionalRawPacketWorker.java	Tue Jul 14 16:53:23 2020 +0200
@@ -36,6 +36,10 @@
     private int[] bufferLengths;
     private int bufferPkts;
 
+    public DpdkUnidirectionalRawPacketWorker(int index) {
+        super(index);
+    }
+
     public void setBufferSize(int bufferSize) {
         this.bufferSize = bufferSize;
     }
--- a/stress-tester/src/main/java/com/passus/st/emitter/raw/PcapUnidirectionalRawPacketEmitter.java	Tue Jul 14 16:00:05 2020 +0200
+++ b/stress-tester/src/main/java/com/passus/st/emitter/raw/PcapUnidirectionalRawPacketEmitter.java	Tue Jul 14 16:53:23 2020 +0200
@@ -38,8 +38,8 @@
     }
 
     @Override
-    protected UnidirectionalRawPacketWorker<PcapOutput> createWorker() {
-        PcapUnidirectionalRawPacketWorker worker = new PcapUnidirectionalRawPacketWorker();
+    protected UnidirectionalRawPacketWorker<PcapOutput> createWorker(int index) {
+        PcapUnidirectionalRawPacketWorker worker = new PcapUnidirectionalRawPacketWorker(index);
         worker.setDumpFile(dumpFile);
         return worker;
     }
--- a/stress-tester/src/main/java/com/passus/st/emitter/raw/PcapUnidirectionalRawPacketWorker.java	Tue Jul 14 16:00:05 2020 +0200
+++ b/stress-tester/src/main/java/com/passus/st/emitter/raw/PcapUnidirectionalRawPacketWorker.java	Tue Jul 14 16:53:23 2020 +0200
@@ -20,6 +20,10 @@
 
     private PcapIfc[] pcapIfcs;
 
+    public PcapUnidirectionalRawPacketWorker(int index) {
+        super(index);
+    }
+
     public String getDumpFile() {
         return dumpFile;
     }
--- a/stress-tester/src/main/java/com/passus/st/emitter/raw/UnidirectionalRawPacketEmitter.java	Tue Jul 14 16:00:05 2020 +0200
+++ b/stress-tester/src/main/java/com/passus/st/emitter/raw/UnidirectionalRawPacketEmitter.java	Tue Jul 14 16:53:23 2020 +0200
@@ -149,7 +149,7 @@
 
     protected abstract UnidirectionalRawPacketWorker<E>[] createWorkersArray(int workersNum);
 
-    protected abstract UnidirectionalRawPacketWorker<E> createWorker();
+    protected abstract UnidirectionalRawPacketWorker<E> createWorker(int index);
 
     @Override
     public void start() {
@@ -159,7 +159,7 @@
 
         workers = createWorkersArray(threads);
         for (int i = 0; i < threads; i++) {
-            UnidirectionalRawPacketWorker<E> worker = createWorker();
+            UnidirectionalRawPacketWorker<E> worker = createWorker(i);
             worker.setPortPool(portPool);
             worker.setMacResolver(macResolver);
             worker.setSessionMapper(sessionMapper);
--- a/stress-tester/src/main/java/com/passus/st/emitter/raw/UnidirectionalRawPacketWorker.java	Tue Jul 14 16:00:05 2020 +0200
+++ b/stress-tester/src/main/java/com/passus/st/emitter/raw/UnidirectionalRawPacketWorker.java	Tue Jul 14 16:53:23 2020 +0200
@@ -59,6 +59,10 @@
 
     private int mtu = DEFAULT_MTU;
 
+    public UnidirectionalRawPacketWorker(int index) {
+        super("UnidirRawPktWorker-" + index);
+    }
+
     public PortPool getPortPool() {
         return portPool;
     }
--- a/stress-tester/src/test/java/com/passus/st/emitter/raw/PcapUnidirectionalRawPacketWorkerTest.java	Tue Jul 14 16:00:05 2020 +0200
+++ b/stress-tester/src/test/java/com/passus/st/emitter/raw/PcapUnidirectionalRawPacketWorkerTest.java	Tue Jul 14 16:53:23 2020 +0200
@@ -57,7 +57,7 @@
 
     @Test
     public void testConnect() throws Exception {
-        PcapUnidirectionalRawPacketWorker worker = new PcapUnidirectionalRawPacketWorker();
+        PcapUnidirectionalRawPacketWorker worker = new PcapUnidirectionalRawPacketWorker(0);
         try {
             worker.setMacResolver(macResolver);
             worker.setPortPool(portPool);