Tracing the Optimization

The tracing feature described here is optional. However, if you want to use this feature, you must turn off the condition optimization setting. The tracing feature enables you to capture information about how your rules were optimized. The information is stored in server.log.

To use the tracing feature, add this property setting in the server.properties file:

rule.dm.trace.optimize.evaluation=true

This setting records in the server.log file the original sequence of conditions and how these conditions are re-ordered (optimized).

To locate the information in the log file, search for the the data monitor’s name. The following example shows the log statements that include the evaluated data monitor’s URI and a sampling of the profiled values. The profile describes the average time in nanoseconds a specific condition took to process. The condition’s position is indicated by an index starting with position 0. The profile in the log indicates that the costliest condition at Index 0 took an average of 1,227 nanoseconds over a sampling of 22:

The following lines indicate the order of conditions (indicated as nodes) as originally defined. Red numbers correspond to the index:

The following lines indicate the optimized order of conditions (indicated as nodes):

Observe how nodes were moved up and down to indicate which conditions are evaluated first. Index 0,originally profiled as the costliest, is now evaluated last.

Note: Filter conditions can have nested filters. In this case, conditions in those nested filters are also evaluated and optimized, but the node listing in the log will not distinguish in which filters the conditions are defined.

To save a filter in its optimized state:

If you are a content author, you can leverage the log information to modify your filter conditions permanently. This procedure is optional.

  1. Refer to the log and re-order the filter conditions accordingly.

  2. Save the filter in this optimized state. Repeat for nested filters as required.

Filters may be shared with other resources, for example, active channels and query viewers. In this case, if you manually optimize filters used by data monitors, other resources using the same filters will benefit from the change. Once filter conditions have been optimized for a data monitor and even if you don’t manually change the filters, you may disable the optimization tool, described in Disabling the Optimization Feature.