UAV supports method-level invocation chains. Users can configure methods that need to be traced in invocation chains and input and output parameters that need to be captured. ivc.data file is the method-level configuration file of invocation chains. When the invocation chain functionality is enabled, UAV shall check the existence of ivc.data file under the parent directory of uavmof.metadata file. UAV shall read and parse the ivc.data file if it exists, and completes automatic injection, tracing and capture based on the configuration.

ivc.data Configuration

Below is the format of ivc.data configuration file:

{
    //appid, the application ID on which the configuration works
   "com.creditease.uav.monitorframework.buildFat": {
      "classes": {
            //class name, the class on which the method-level tracing and capture is configured
           "com.creditease.monitorframework.fat.MyTestIVCInjectClass": {
              //method list, the list of methods on which the method-level tracing and capture is configured. Each method shall contain the list of input parameters and the lists of input and out parameters that are required to be captured
              "methods":
              [
                // name: method name; types: the list of input parameters (can be an empty array) of the method; args: the lists of input parameters (begin with 1) and output parameters (represented by -1) that are required to be captured
                // Input and output parameters that are required to be captured shall be stored in the invocation chain data for frontend display
                {name:" testMethod1",types: ["String","MyTestInjectObj"],args: [ 1,-1 ]},
                {name:" testMethod2 ",types: ["String","MyTestInjectObj","boolean"],args: [ 1,2 ]},
                {name:" testMethod3 ",types: ["String","int"],args: [ 1,2,-1 ]},
                {name:" testMethod4 ",types: ["Integer"],args: [ 1,-1 ]},
                {name:" testMethod5",types: ["Double"],args: [ 1,-1 ]},
                {name:" testMethod6 ",types: ["Float"],args: [ 1,-1 ]},
                {name:" testMethod7 ",types: ["Boolean"],args: [ 1,-1 ]},
                {name:" testMethod8 ",types: [],args: []}
             ]
         }
     }
  }
}
  • com.creditease.uav.monitorframework.buildFat: appid, refers to the id of the application which shall be configured with the method-level tracing . Replace “com.creditease.uav.monitorframework.buildFat” with the id of your application which shall be configured with the method-level tracing

  • classes: keyword of class. Compusolry. Set to be “classes”

  • com.creditease.monitorframework.fat.MyTestIVCInjectClass: the class which shall be configured with the method-level tracing. Replace “com.creditease.monitorframework.fat.MyTestIVCInjectClass” with your class which shall be configured with the method-level tracing

  • methods: keyword of method. Compulsory. Set to be “methods”. The corresponding value is the list of methods which shall be configured with the method-level tracing

  • name: keyword of method. The corresponding value is the name of the method which shall be configured with the method-level tracing

  • types: keyword of the method parameter list. The corresponding value is the list of the names of the input classes. It can be an empty array [] if there is no input parameter for the method

  • args: lists of input and output parameters that need to be traced. 1 for the first input parameter, 2 for the second input parameter, and so on. -1 for output parameter

Above configuration denotes monitoring over testMethod1 to testMethod9 in the class com.creditease.monitorframework.fat.MyTestIVCInjectClass of the application whose ID is com.creditease.uav.monitorframework.buildFat on the machine where UAV is located. testMethod1 has two input parameters, namely String and MyTestInjectObj. args:[1,-1] denotes to capture the first input paramenter (1, i.e. String parameter) and output parameter (-1). testMethod2 has three input parameters, namely String, MyTestInjectObj and boolean. args:[1,2] denotes to capture the first and the second input parameters. There is no input parameter in testMethod8 and does not to capture input or output parameters.

Example

Below is an ivc.data configuration example. This example is configured to capture three methods:

{
   "com.creditease.uav.monitorframework.buildFat": {
      "classes": {
            "com.creditease.monitorframework.fat.MyTestIVCInjectClass": {
               "methods":
               [
                  {"name":" testMethod1 ","types": ["String","MyTestInjectObj"],"args": [ 1,2,-1 ]},
                  {"name":" testMethod1 ","types": ["String","MyTestInjectObj","boolean"],"args": [ 1,2,3,-1 ]},
                  {"name":" testMethod2 ","types": ["String","int"],"args": [ 1,2,-1 ]}
               ]
            }
        }
   }
}

Below is the invocation chain displayed at the frontend of the ivc.data configuration, which captures three methods (in the type of M as shown in the red square): testMethod1, testMethod1 and testMethod2, which respond to the ivc.data configuration above.

Click on each method to view invocation chain details of the method, including the input parameter, output parameter, time of invocation, and the class to which the method belongs, etc.. Both input and output parameters shall be displayed in the form of character strings escaped via toString. The maximum length of character strings shall be decided by com.creditease.uav.ivcdat.method.ret configured in uav.properties. Otherwise, the maximum length shall be deemed as 2000 characters by default. Below are invocation chain details in testMethod1, where two input parameters separated by “;” are captured. The first input parameter is “1” as String; the second is “com.creditease.monitorframework.fat.ivc.MyTestInjectObj@116bdeb2” as MyTestInjectObj. The output parameter is “success” as String.

results matching ""

    No results matching ""