Processor: Match Percentage

For each input group, the Match Percentage processor creates a single output that is the percentage of items in the input group that are equal to the reference.

Input Types - Discrete-State-Set (DSS), TS

Output Types - Number-Set (NS)


Group by (group_by)

Accepts a list of property names to group input items into output items, produces only one output group for the empty list.Most processors take input and produce output. Many of them produce one output per input (for example, if input is a DSS, output is a DSS of same size). However, some processors reduce the size of the output relative to the size of the input. Effectively, they partition the input into groups, run some calculation on each of the groups that produce a single value per each group, and use that as output. Clearly, the size of the output set depends on the grouping scheme. We call such processors grouping processors and they all take the Group by configuration parameter.

In the case of an empty list, the input is considered to be a single group; thus, the output is of size 1 and either N, DS, or TS. If a list of property names is specified, for example [“system_id”, “iface_role”], or a single property is specified, for example [“system_id”], we divide the input into groups such that for each group, every item in the group has the same values for the given list of property names. See the standard deviation processor example for how this works.

The output type of a processor depends on a value of the group_by parameter; for an empty list, a processor produces a single value result, such as N, DS, or T, and for grouping by one or more properties it returns a set result, such as NS, DSS, or TS.

Reference State (reference_state)
DS or TS value which is used as a reference state to match input samples.
Enable Streaming (enable_streaming)
Makes samples of output stages streamed if enabled. An optional boolean that defaults to False. If set to True, all output stages of this processor are streamed in the generic protobuf schema.

Match Percentage Example

Assume a configuration of:

reference_state: "false"
group_by: []

Sample Input:

[if_name=eth0] : "true"
[if_name=eth1] : "true"
[if_name=eth3] : "false"

Sample Output:

[] : 33

In the above example, we have 33% as the output because 33% of the input group match the reference value of “false”.