Skip to content

Commit 4fdd1a4

Browse files
committed
queueing: Fix CompoundPacketQueueBase statistics counting inner submodule signals when warmup-period is set
The signal-source statistics (incoming/outgoing packets, packet lengths, data rates, queueing times, dropped packets, and the flow-specific rates) use the localSignal() result filter so that the compound queue records only its own packetPushStarted/packetPulled/... signals and ignores the identical signals emitted by its inner submodules (the contained queues and the scheduler), which otherwise propagate up the module hierarchy. localSignal() can only test the signal source when it is the head of the result-filter chain (its receiveSignal(cComponent*, ...) overloads); once it receives values from an upstream filter it forwards them unconditionally. When warmup-period is set, OMNeT++ inserts an automatic WarmupPeriodFilter at the head of the chain (unless autoWarmupFilter=false), demoting localSignal and turning it into a no-op. The compound queue then also counts the packetPulled signals of its inner queue and scheduler, inflating e.g. outgoingDataRate by 3x (inner queue + scheduler + compound) and driving queueLength negative. Fix each affected statistic the way queueLength/queueBitLength already do it: set autoWarmupFilter=false to suppress the auto-inserted filter, and wrap the source in an explicit warmup() outside localSignal() so localSignal stays at the head while warmup semantics are preserved. No effect when warmup-period is 0.
1 parent 4e87843 commit 4fdd1a4

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

src/inet/queueing/queue/CompoundPacketQueueBase.ned

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,28 @@ module CompoundPacketQueueBase extends PacketQueueBase like IPacketQueue
3434
// the statistical value is the total bit length of all packets in the queue
3535
@statistic[queueBitLength](title="queue bit length"; source=warmup(atomic(constant0(localSignal(packetPushEnded)) + sum(packetLength(localSignal(packetPushStarted))) - sum(packetLength(localSignal(packetPulled))) - sum(packetLength(localSignal(packetRemoved))) - sum(packetLength(localSignal(packetDropped))))); record=last,max,timeavg,vector; unit=b; interpolationmode=sample-hold; autoWarmupFilter=false);
3636
// the statistical value is the queueing time of packets
37-
@statistic[queueingTime](title="queueing times"; source=queueingTime(localSignal(packetPulled)); record=histogram,vector; unit=s; interpolationmode=none);
37+
@statistic[queueingTime](title="queueing times"; source=queueingTime(warmup(localSignal(packetPulled))); record=histogram,vector; unit=s; interpolationmode=none; autoWarmupFilter=false);
3838
// the statistical value is the incoming packet
39-
@statistic[incomingPackets](title="incoming packets"; source=localSignal(packetPushStarted); record=count; unit=pk);
39+
@statistic[incomingPackets](title="incoming packets"; source=warmup(localSignal(packetPushStarted)); record=count; unit=pk; autoWarmupFilter=false);
4040
// the statistical value is the length of the incoming packet
41-
@statistic[incomingPacketLengths](title="incoming packet lengths"; source=packetLength(localSignal(packetPushStarted)); record=sum,histogram,vector; unit=b; interpolationmode=none);
41+
@statistic[incomingPacketLengths](title="incoming packet lengths"; source=packetLength(warmup(localSignal(packetPushStarted))); record=sum,histogram,vector; unit=b; interpolationmode=none; autoWarmupFilter=false);
4242
// the statistical value is the data rate of the incoming packets
43-
@statistic[incomingDataRate](title="incoming datarate"; source=throughput(localSignal(packetPushStarted)); record=vector; unit=bps; interpolationmode=linear);
43+
@statistic[incomingDataRate](title="incoming datarate"; source=throughput(warmup(localSignal(packetPushStarted))); record=vector; unit=bps; interpolationmode=linear; autoWarmupFilter=false);
4444
// the statistical value is the outgoing packet
45-
@statistic[outgoingPackets](title="outgoing packets"; source=localSignal(packetPulled); record=count; unit=pk);
45+
@statistic[outgoingPackets](title="outgoing packets"; source=warmup(localSignal(packetPulled)); record=count; unit=pk; autoWarmupFilter=false);
4646
// the statistical value is the length of the outgoing packet
47-
@statistic[outgoingPacketLengths](title="outgoing packet lengths"; source=packetLength(localSignal(packetPulled)); record=sum,histogram,vector; unit=b; interpolationmode=none);
47+
@statistic[outgoingPacketLengths](title="outgoing packet lengths"; source=packetLength(warmup(localSignal(packetPulled))); record=sum,histogram,vector; unit=b; interpolationmode=none; autoWarmupFilter=false);
4848
// the statistical value is the data rate of the outgoing packets
49-
@statistic[outgoingDataRate](title="outgoing datarate"; source=throughput(localSignal(packetPulled)); record=vector; unit=bps; interpolationmode=linear);
49+
@statistic[outgoingDataRate](title="outgoing datarate"; source=throughput(warmup(localSignal(packetPulled))); record=vector; unit=bps; interpolationmode=linear; autoWarmupFilter=false);
5050
// the statistical value is the packet that is dropped due to queue overflow
51-
@statistic[droppedPacketsQueueOverflow](title="dropped packets: queue overflow"; source=packetDropReasonIsQueueOverflow(localSignal(packetDropped)); record=count; unit=pk; interpolationmode=none);
51+
@statistic[droppedPacketsQueueOverflow](title="dropped packets: queue overflow"; source=packetDropReasonIsQueueOverflow(warmup(localSignal(packetDropped))); record=count; unit=pk; interpolationmode=none; autoWarmupFilter=false);
5252
// the statistical value is the length of the packet that is dropped due to queue overflow
53-
@statistic[droppedPacketLengthsQueueOverflow](title="dropped packet lengths: queue overflow"; source=packetLength(packetDropReasonIsQueueOverflow(localSignal(packetDropped))); record=sum,vector; unit=b; interpolationmode=none);
53+
@statistic[droppedPacketLengthsQueueOverflow](title="dropped packet lengths: queue overflow"; source=packetLength(packetDropReasonIsQueueOverflow(warmup(localSignal(packetDropped)))); record=sum,vector; unit=b; interpolationmode=none; autoWarmupFilter=false);
5454
// the statistical value is the flow specific queueing time of packets
55-
@statistic[flowQueueingTime](title="flow queueing times"; source=queueingTime(demuxFlow(localSignal(packetPulled))); record=histogram,vector; unit=s; interpolationmode=none);
55+
@statistic[flowQueueingTime](title="flow queueing times"; source=queueingTime(demuxFlow(warmup(localSignal(packetPulled)))); record=histogram,vector; unit=s; interpolationmode=none; autoWarmupFilter=false);
5656
// the statistical value is the flow specific data rate of the incoming packets
57-
@statistic[flowIncomingDataRate](title="flow specific incoming data rate"; source=throughput(flowPacketLength(demuxFlow(localSignal(packetPushStarted)))); record=vector; unit=bps; interpolationmode=linear);
57+
@statistic[flowIncomingDataRate](title="flow specific incoming data rate"; source=throughput(flowPacketLength(demuxFlow(warmup(localSignal(packetPushStarted))))); record=vector; unit=bps; interpolationmode=linear; autoWarmupFilter=false);
5858
// the statistical value is the flow specific data rate of the outgoing packets
59-
@statistic[flowOutgoingDataRate](title="flow specific outgoing data rate"; source=throughput(flowPacketLength(demuxFlow(localSignal(packetPulled)))); record=vector; unit=bps; interpolationmode=linear);
59+
@statistic[flowOutgoingDataRate](title="flow specific outgoing data rate"; source=throughput(flowPacketLength(demuxFlow(warmup(localSignal(packetPulled))))); record=vector; unit=bps; interpolationmode=linear; autoWarmupFilter=false);
6060
@defaultStatistic(queueLength:vector);
6161
}

0 commit comments

Comments
 (0)