WRED/ECN are congestion management techniques, which work at queue level to drop/mark packets randomly after queue size exceeding the configured queue threshold. The queue size is determined using Exponentially weighted moving average (EWMA) technique with queue weight, previous queue size, current queue size as variables. 

EOS 4.31.1F Queue Weight