HP Caliper Advisor Rule Writer Guide
get_run_info_nth(metric_list, n)
These accessor functions are expected to be available in future releases of HP Caliper:
• Used to retrieve call graph profiles (not yet available for use):
get_call_graph(metric_list)
get_call_graph_nth(metric_list, n)
• Used to retrieve information about the source code (not yet available for use):
get_source_info(item, metric_list)
get_source_info_nth(item, metric_list, n)
• Used to retrieve information about the compiled code (not yet available for use):
get_binary_info(item, metric_list)
get_binary_info_nth(item, metric_list, n)
• Used to retrieve information about how an application was built (not yet available
for use):
get_build_info(item, metric_list)
get_build_info_nth(item, metric_list, n)
For details about the accessor functions, see “HP Caliper Advisor Accessor Functions”
(p. 37).
NOTE: The “not yet available for use” functions are listed for future compatibility.
Stub accessor functions exist for all of the “not yet available for use” functions. In the
current Advisor, they always return the None value. If a future rule that calls one of
these functions is used with this version of the Advisor, it will work correctly and not
raise a Python exception due to an undefined function.
Arguments and Return Values
All accessor functions come in two “flavors”: a base version and an nth version. The
base version always returns metric values from the first (and possibly only) dataset
that matches. The nth version allows a rule to search for multiple datasets that might
provide the requested metric(s). The nth version is a superset of the base version and
takes the same argument list as the base version plus one additional final argument.
If the final argument (the n argument) to an nth accessor function is zero or greater,
the accessor function will only examine the nth dataset for a match. If that dataset
contains all of the requested metrics, then they are successfully returned. If that dataset
does not contain all of the metrics or if there is no nth dataset, then the None value is
returned.
If the final argument (the n argument) to an nth accessor function is negative, then the
abs(nth) matching dataset is returned. That is, if the nth value is –1, then the first
dataset to contain all of the requested metrics is returned. If the nth value is –2, then
Accessor Functions 33