From: Feng Q. <fen...@ma...> - 2003-11-18 19:46:03
|
>That is, if I have a heirarchy: >Class A >Class B Extends A >Class C Extends B > >And then I have a method somewhere: void foo(A someParam){ blah } > >I want to track how many times C is getting invoked for each of someParam >being {A,B,C} at runtime. > > If that's only information you need, I would say instrumentation at bytecode level is much easier. For exmaple, at the beginning of your foo method, you can add: if (someParam instanceof A) Acount ++; else if (someParam instanceof B) Bcount ++; else Ccount ++; Cheers, Feng |