HP Caliper Advisor Rule Writer Guide
HP Caliper ships with a standard set of rules that the Advisor uses. For most users,
these rules will be all they will need. But if you want to customize these rules or add
your own, you will need to study this Guide.
Rules are written in the Python scripting language. Simple rules can be written in just
a few statements; complex rules can take pages of code. There is a large infrastructure
within the Advisor that identifies the application objects to be analyzed, processes all
collected measurement data, invokes the set of analysis rules, and reports the generated
advice. The rules only need to deal with their analysis and advice.
For information about Python, see “Python Scripting Language: Overview” (p. 65).
Each rule file contains one or more independent rule functions. A rule function retrieves
performance data, makes decisions about a possible performance problem, and generates
advice messages if appropriate. The terms rule and rule function are synonymous.
Figure 1-3 “Typical Rule Used by the HP Caliper Advisor” shows a sample rule that
demonstrates all of the components of a well-written rule. This rule will be fully
explained later. For now, you should simply read through the code and get a brief
understanding of what it is doing.
What Are Analysis Rules? 17