Bytecode Instrumentation
| 2004 JavaOne
SM
Conference | Session 3042 Copyright Hewlett Packard Co., 2004.
68
Test environment
•
Goal: Count method entries for method
consuming most time
• Class A1 has two methods: a1() and a2()
─ Collect amount of time spent in each
• Separate thread wakes up periodically
─ Switches preference for calling a1() or a2()
• Thread launched from Agent
─ Periodically wakes up
─ Accesses performance information
─ Instrument the method with the highest time