# Begins timer to trace how long each resource takes to collect its availability
RULE BeginAvail
CLASS org.rhq.core.pc.inventory.AvailabilityExecutor
METHOD checkInventory
AT ENTRY
BIND res:Resource = $1
IF TRUE
DO createTimer($1)
ENDRULE

# Dumps message indicating how long a resource took to collect its availability
RULE EndAvail
CLASS org.rhq.core.pc.inventory.AvailabilityExecutor
METHOD checkInventory
AT EXIT
BIND res:Resource = $1,
     elap:long = getElapsedTimeFromTimer($1),
     deleted:boolean = deleteTimer($1)
IF elap > 20
   DO traceln("AVAIL ms=" + elap + ", res=" + res.getName())
ENDRULE
