HP Caliper Advisor Rule Writer Guide
‘USER_TIME’,
‘SYSTEM_TIME’, n)
metrics1: (124935886799, 30681829351, 64202559764,
25948247862, 3)
metrics2: (40.924244999999, 40.16219256499998,
0.017941971000000001)
This example demonstrates how the get_run_info_nth accessor function is
usually used.
The first statement attempts to retrieve four total PMU count metrics. These are
the default PMU events measured by an HP Caliper ecount measurement run
on Itanium 2 processors. If performance data for such a run is among the datasets
being analyzed, then the get_metrics call returns the performance data plus
the ID number of the dataset used in a 5-element tuple. If this performance data
is not available, then metrics1 is set to the None value.
The “if” statement will be True if metrics1 is not None, and the next two
statements will be executed. The first of these extracts the value of n from the first
metrics set. (Python numbers elements starting with 0.)
Finally, the get_run_info_nth() call retrieves the real, user, and system time
from the same dataset that supplied the total PMU count metrics. This illustrates
the technique of chaining.
52 HP Caliper Advisor Accessor Functions