Monitoring rules statistics

You can monitor rules statistics that provide insight as to how frequently individual statements within a rule execute and how long it takes to run a rule statement.

About this task

Statistics about rule execution are stored in the }StatsByRule control cube.

Each time a rule is changed or compiled, the data for that rule is cleared and updated in the }StatsByRule control cube. This helps you to immediately see the impact of a rule change. The data in the }StatsByRule control cube does not persist between server sessions; it is cleared every time that you restart your TM1 server.

The }StatsByRule cube contains three dimension:
  • }Cubes - Contains elements corresponding to each cube on your TM1 server.
  • }LineNumber - Contains elements 1 through 10,000, corresponding to line numbers in a TM1 rules .rux file.
    Tip: The TM1 Rules Editor does not display line numbers. Open the .rux file in a text editor that supports line numbers to view the line numbers for a rule.
  • }Rules Stats - Contains elements corresponding to the information and statistics that are collected for rules, including:
    • Rule Text - The first portion of a rule statement, provided to help you identify the statement.
    • Total Run Count - The total number of times the rule statement has run.
    • Min Time - The minimum amount of time taken for the rule statement to run, in milliseconds.
    • Max Time - The maximum amount of time taken for the rule statement to run, in milliseconds.
    • Total Time - The total amount of time taken for the rule statement to run, in milliseconds.
    • Last Run Time - The amount of time, in milliseconds, it took for the most recent execution of the rule statement.

Rule statistics collection is enabled on a per-cube basis by setting the RULE_STATS property to YES in the }CubeProperties control cube.

Note: The collection of rule statistics does incur a slight performance cost that increases with the frequency of rule execution. You should enable statistic collection only while debugging or tuning your rules. During normal operation you should disable statistic collection.

Procedure

  1. Open the }CubeProperties control cube.
  2. For each rule that you want to collect statistics, enter YES in the cell at the intersection of the cube name and the RULE_STATS property.
    The }CubeProperties control cube, showing the RULE_STATS property enabled.
    Note: RULE_STATS is a dynamic parameter. It does not require a server restart to take effect, but there may be a delay of up to 60 seconds before the property is applied.

    The TM1 server is now collecting statistics for the rules where the RULE_STATS property is YES. Any execution of the rules from this point forward will result in data stored in the }StatsByRule control cube.

    When you want to disable the collection of rule statistics, set the RULE_STATS property to NO.

  3. Open the }StatsByRule control cube.
  4. Review the statistics stored for each statement in your TM1 rule. These statistics can help you identify which statements might be running more frequently than intended or are taking a long time to run. You can use this information to modify your rules.
    The }StatsByRule control cube showing rule statistics.

    The }LineNumber elements in this view correspond to the line numbers in the associated .rux file. If a rule statement occupies multiple lines in the .rux file, the line number shown in this view is the line on which the rule statement starts.

    The times recorded for Min Time, Max Time, Avg Tme, Last Run time, and Total Time are in milliseconds (one one-thousandth of a second). Some rule statements execute faster than 1 millisecond, resulting in an entry of 0 for the time. It's possible for a simple rule statement to run multiple times, while the Total Time shows as 0.

  5. To view statistics for a different rule, select the associated cube name from the }Cubes dimension at the top of the view.