HP Caliper Advisor Rule Writer Guide
5 HP Caliper Advisor Advice Function
This chapter describes the HP Caliper Advisor advice function.
The advice function is called by an analysis rule to generate advice about the user's
application performance.
There is only one advice() function, but different types of advice can be produced
by various combinations of the optional arguments. A rule function only calls advice()
when it has determined that its advice is applicable to the program being analyzed. In
fact, most rules will not call advice() during any one analysis run.
It is also possible, though very unlikely, that a rule generates more than one piece of
advice. Usually, this means that the rule is a candidate to be broken up into two or
more simpler rules.
A rule might produce advice, but that does not guarantee that it will be printed in the
analysis report. All of the rule-generated advice is filtered, sorted (from most important
advice to least important), and subject to cutoff limits. This actually makes the work
of rules easier. Each rule focuses on its particular performance area and determines to
what extent the available performance data indicates that the problem may exist. The
Advisor balances the relative importance of all the advice and decides what to report
to the user. Users can exercise control over what type and how much advice they want.
Syntax of the Advice Function
The syntax is:
advice(index, class, [description], [improvement], [measurement], [explanation])
where:
index
The index value represents the impact of this advice. It is a mixture
of the certainty that this advice applies to this application, the
percentage of elapsed time that could be saved if the problem were
eliminated, and the likelihood that savings could be realized.
A floating-point value between 0.0 and 100.0.
class
The advice class represents the classification of this advice. All advice
is classified by what performance area it mostly deals with.
An integer value (one of the following):
• GENERAL_ADVICE (general advice or advice that fits into
more than one of the specific categories)
• CPU_ADVICE (advice pertaining to non-memory CPU cycles)
• MEMORY_ADVICE (advice pertaining to memory-related
performance)
Syntax of the Advice Function 53