However, which one should we use ? If you prefer the event-based and packet-based analysis, then please use trace-queue. For sample-based analysis and time-aggregated statistics, the monitor-queue is a better choice.
# example 1: capture every packet in the queue of the link of n0 to n1, and store the trace in qm.tr
set f1 [open qm.tr w]
$ns trace-queue $n0 $n1 $f1
# example 2 : sample the q every 0.1 sec. store the trace in qm.mon
set qm [$ns monitor-queue $n0 $n1 [open qm.mon w] 0.1];
[$ns link $n0 $n1] queue-sample-timeout;

