How do I collect metrics on overloaded methods?

Document ID : KB000067665
Last Modified Date : 13/03/2018
Show Technical Document Details
Question:

How do I collect metrics on overloaded methods?

Environment:
Introscope from 9.7x to 10x
Answer:

To collect metrics from overloaded methods use TraceOneMethodWithParametersOfClass in a pbd file. The following is an example class with the corresponding pbd definitions:

 

  Class definition
  public class MyTest {
      void myOverloadMethod(String s ) {
         // ...
     }
 

     String myOverloadMethod(String s1, String s2 ) {
         // ...
     }

     void myOverloadMethod(MyClass2 m ) {
         // ...
      }
  }

 

  Creating pbd definitions:

  TraceOneMethodWithParametersOfClass: MyTest myOverloadMethod(Ljava/lang/String;)V MethodTimer "JWangApp|{classname}|{method}|{0}:Average Response Time (ms)"

  TraceOneMethodWithParametersOfClass: MyTest myOverloadMethod(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; MethodTimer "JWangApp|{classname}|{method}|{0} {1}:Average Response Time (ms)"

  TraceOneMethodWithParametersOfClass: MyTest myOverloadMethod(LMyClass2;)V MethodTimer "JWangApp|{classname}|{method}|{0}:Average Response Time (ms)"