HP Caliper Advisor Rule Writer Guide
Examples Showing How Advice Is Printed
• The following rule:
def rule_sample_advice_1(object):
object.advice(19.9, GENERAL_ADVICE, "Description text.", "Improvement text.",
"Measurement text", "Explanation text.")
is printed as:
-------------------------------------------------------------------------------
Index Class Analysis
-------------------------------------------------------------------------------
19.9 general Description text. [sample_advice_1]
Improvement text.
Measurement text
Explanation text.
-------------------------------------------------------------------------------
• The following rule:
def rule_sample_advice_2(object):
object.advice(12.1, CPU_ADVICE, "General text handling.",
"This is 'normal' text which has some natural word breaks "
"and is generally what a rule will generate for one or "
"more parts of the advice that is produces.")
is printed as:
Index Class Analysis
-------------------------------------------------------------------------------
12.1 cpu General text handling. [sample_advice_2]
This is 'normal' text which has some natural word breaks and
is generally what a rule will generate for one or more parts
of the advice that is produces.
-------------------------------------------------------------------------------
• The following rule:
def rule_sample_advice_3(object):
object.advice(9.75, MEMORY_ADVICE, "Long word wrapping.",
"Here_is_a_really_long_word_that_can’t_fit_on_a_single_line_"
"and_must_be_wrapped_not_at_a_word_boundary.__This_may_"
"happen_when_printing_demangled_C++_names.")
is printed as:
-------------------------------------------------------------------------------
Index Class Analysis
-------------------------------------------------------------------------------
9.8 memory Long word wrapping. [sample_advice_3]
Here_is_a_really_long_word_that_can't_fit_on_a_single_line_and
_must_be_wrapped_not_at_a_word_boundary.__This_may_happen_when
_printing_demangled_C++_names.
-------------------------------------------------------------------------------
• The following rule:
def rule_sample_advice_4(object):
object.advice(9.75, IO_ADVICE, "Rule-controlled formatting.",
"This is an example of a rule which wants to print a list "
"of hot function names in a readable way. Here are the hot "
Examples Showing How Advice Is Printed 55