Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Processor: Ratio

The Ratio processor calculates the ratio of inputs. It takes two inputs: numerator and denominator. Denominator is optional and could be specified as 'denominator' configuration property instead. It could be either an integer or an expression that evaluates to an integer. It should not be '0'.

When 'denominator' is specified as an input, 'numerator' and 'denominator' input items must allow only 1:1 mapping. If that is not the case, 'significant_keys' configuration property should be specified to list keys that will allow such mapping.

It also supports 'multiplier' configuration property, which is an integer value greater than one to multiply numerator by before calculating ratio. This allows it to overcome limitations of dealing with integers. Default value is 100.

Parameter Description
Input Types Table (number)
Output Types Table (number)
Denominator Integer or an expression that evaluates to integer that is used as denominator. Optional denominator value if it's not specified as input; should be non-zero integer or an expression that evaluates to non-zero integer.
Significant Keys (significant_keys)

List of keys to map items from the inputs for applying the specified operation. It is typically used by processors that take multiple inputs and perform operations on them. When inputs have the same sets of keys it does not need to be specified. When inputs have different sets of keys, it must be specified and it must allow only 1:1 items mapping from the given inputs, otherwise the probe will go into error state.

Multiplier Multiply numerator by a given value before calculating ratio. Optional. Default is 100.
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.


In the Add Processor window of the Apstra UI, hover over the "Ratio With Static Denominator" or "Ratio With Static Denominator Input" tooltips for visual examples of how the Ratio processor functions.


Example: Ratio Output

Simple scenario with a static denominator.

Input 'numerator':

Output:

Configuration where numerator and denominator are coming from inputs, and 'multiplier' value is the default 100:

Input 'numerator':

Input 'denominator':

Output: