-
Notifications
You must be signed in to change notification settings - Fork 81
RandomSample
Tom Barbette edited this page May 7, 2020
·
3 revisions
RandomSample — Click element; samples packets with some probability
RandomSample([P, KEYWORDS])
Batching: Batching natively supported
Ports: 1 input, 1-2 outputs
Processing: agnostic, but output 1 is push
Samples packets with probability P. One out of 1/P packets are sent to the first output. The remaining packets are dropped, unless the element has two outputs, in which case they are emitted on output 1.
If you don't specify P, you must supply one of the SAMPLE and DROP keyword arguments.
Keyword arguments are:
- SAMPLE P — Sets the sampling probability to P.
- DROP Q — The element will drop packets with probability Q. Same as suppling (1 - Q) as the sampling probability.
- ACTIVE — Boolean. RandomSample is active or inactive; when inactive, it sends all packets to output 0. Default is true (active).
- sampling_prob (read/write) — Returns or sets the sampling probability.
- drop_prob (read/write) — Returns or sets the drop probability, which is 1 minus the sampling probability.
- active (read/write) — Makes the element active or inactive.
- drops (read-only) — Returns the number of packets dropped.
Generated by click-elem2man from ../elements/standard/randomsample.hh:8
on 2020/05/07.