Configure Offset Time
The Paragon Insights offset time unit is used in conjunction with the About the Frequency Profiles to automatically manage time range calculations in various places within Paragon Insights rules. To understand the Paragon Insights offset function, consider the following scenario:
In Paragon Insights, you can define a rule which
Uses a sensor to gather data with a frequency of 10 seconds
Has a field that calculates the mean every 60 seconds
If you later decide to increase the frequency of the sensor to 60 seconds, then calculating the mean every 60 seconds would not make any sense. The result is that you would have to manually update the field calculation any time up want to change the sensor frequency.
You can set the time range for the mean calculation to a value of 6o, or 6offset, rather than 60s, or 60 seconds. Using an offset time value rather than a static time value tells Paragon Insights to automatically multiply the sensor frequency by the numeric value of the offset. Thus, any change to sensor frequency will automatically be included in the time range calculation for a formula.
An offset time unit can be used in place of standard time units in the following time range locations:
Formulae
References
Vectors
Trigger Frequency
Trigger Term
Offset Used in Formulae
In this example, we are creating a rule, Rule1, with a sensor, Sensor1. The sensor frequency is set to 10 seconds.
In Figure 1 below, you can see the Fields block definition for Rule1 with the Sensors block definition framed in green. The formula, formula1, has a Time range value of 2o
Usage Notes for Offset Used in Formulas
An offset value applied to the time range of a formula multiplies the rule, sensor, or trigger frequency of that rule.
The result of this example is that the time range for the Max formula is now 2 times the Sensor1 frequency of 10 seconds, or 20 seconds (2 * 10s = 20s).
If a frequency profile of 30 seconds is applied to the rule used in the example, then the resulting time-range would be 60 seconds (2 * 30s = 60s).
Offset time can be applied to the following formulas: latest, count, min, max, sum, mean, on-change, and stdev.
Offset Used in Reference
In this example, there are two rules in play, but only one is shown. The unseen rule, Rule1, is in the topic routing-engines and is named routing-engines (routing-engines/routing-engines). Rule1 has a frequency of 20 seconds. Rule1 is referenced .
Rule2, shown in Figure 2, is a network rule which has a reference field named ref1. The field, ref1, references back to Rule1 through the Reference XPath Expression with a Time Range setting of 3offset.
Usage Notes for Offset Used in References
Offset values used in references multiply the frequency of the referenced rule by the offset value. In this case, the 20 second frequency of Rule1 is multiplied by 3, resulting in a 60 second time-range (3 * 20s = 60s).
If a frequency profile of 60 seconds (60s) was applied to Rule1, the time range for the reference would increase to 180 seconds (3 * 60s = 180s).
Offset Used in Vectors
In this example, there are 3 rules at play. Rules Rule1 and Rule2 are not shown but are referenced by the vector.
Rule1 is in topic line-cards and is named line-cards (line-cards/line-cards) and has a frequency of 20 seconds (20s).
Rule2 is in topic routing-engines and is named routing-engines (routing-engines/routing-engines) and has a frequency of 30 seconds (30s).
In Rule3 below, we have defined a vector, vector1 that consists of 2 path references and 1 field. The vector has a Time Range defined as 3offset. Figure 3 shows the vector block definition in the Paragon Insights GUI.
Usage Notes for Offset Used in Vectors
An offset value defined in the time range of a vector multiplies the sensor or rule frequency of the referenced rule or sensor. If a field from the same rule is used as the reference, then the frequency of the rule containing the vector is used.
When multiple references or fields are defined for a vector and offset time is used, the offset value is applied to each path independently. So, for this example in which our offset value is 3 (3offset):
The path reference to Rule1: “/device-group[device-group-name='Core4']/device[device-id='R1']/topic[topic-name='line-cards']/rule[rule-name='line-cards']/memory” which has a frequency of 20 seconds, would result in a time range of 60 seconds for the vector (3 * 20s = 60s).
The path reference to Rule2: “/device-group[device-group-name='Core4']/device[device-id='R1']/topic[topic-name='routing-engines']/rule[rule-name='routing-engines']/field[slot='0']/ref1” which has a frequency of 30 seconds, would result in a time range of 90 seconds for the vector (3 * 30s = 90s).
Note:There are no spaces or line breaks in the path references. They are added to this document only to enhance readability.
The field reference to
formula1
: Sinceformula1
is a normal field used within the vector block, the rule frequency of the current rule is used as a basis. So, the time range forformula1
is 30 seconds (3 * 10s = 30s).
If a frequency profile of 60 seconds is applied to Rule1 (line-cards/line-cards), then the time range for that path in the vector would be 180 seconds (3 * 60s = 180s).
If a frequency profile of 120 seconds is applied to Rule2 (routing-engines/routing-engines), then the time range for that path in the vector would be 360 seconds (3 * 120s = 360s).
The time range for the field reference,
formula1
, would remain the same as before at 30 seconds unless a change is made to Rule3 or a frequency profile with a different time is applied to Rule3.
Offset Used in Trigger Term
In this example, we have one rule, Rule1. Figure 4 below shows the trigger block definition with the sensor block definition overlaid with a green border.
The rule, Rule1, has a sensor frequency of 10 seconds (10s) applied.
The trigger itself, Trigger1, has an offset frequency of 2 (2o) applied.
The trigger term, term1, has its own time range offset of 2 (2o) applied as well.
Usage Notes for Offset Time Used in Triggers
An offset value defined in trigger frequency multiplies the sensor or rule frequency. So, the offset value of 2 in trigger1 causes the trigger frequency to be interpreted as 20 seconds (2 * 10s = 20s) because the sensor frequency of the rule is used as the basis.
An offset value defined in a trigger term multiplies the trigger frequency value. So, the offset value of 2 in term1 causes the term frequency to be interpreted as 40 seconds (2 * 20s = 40s).
Offset Used in Frequency Profile Applied to a Rule
In this example, we have 2 rules in the topic external, and one frequency profile, prof1.
The rules are:
external/test: The test rule has a sensor named components which is an OpenConfig sensor with a sensor path of /components and a sensor frequency of 10 seconds.
It also has a trigger, trig1 with a frequency of 2o or 2offset. The trigger has a term named Term_1, which is not used in the example.
external/ref: The ref rule is a non-sensor rule, which means that the rule uses a reference field, trigger_reference, to reference the sensor defined in another rule; in this case external/test.
And the frequency profile is:
prof1: The prof1 profile sets the frequency for the /components sensor at 30 seconds.
Usage Notes for Offset Time Used in Trigger Reference
An offset value defined in trigger frequency multiplies the sensor or rule frequency. So, the offset value of 2 in trig1 causes the trigger frequency to be interpreted as 20 seconds (2 * 10s = 20s) because the sensor frequency of the rule is used as the basis.
An offset value defined in a rule reference external/ref is 2. This value multiplies the frequency value of 30s in frequency profile prof1 (the frequency configure in frequency profile prof1 (30s) takes precedence over the sensor frequency of 10s configured in external/test/ rule). So, the offset value of 2 in rule ref causes the frequency to be interpreted as 60 seconds (2 * 30s = 60s).