An example of creating and using BackendMarker.

Document ID : KB000010309
Last Modified Date : 14/02/2018
Show Technical Document Details
Introduction:

 This document describes creating a dummy application to simulate a backend metric.

Environment:
Any Introscope Java Agent.
Instructions:

 1. Create a HelloWorld Dummy application:

import java.util.*;

 

import java.text.*;

 

public class ProbedHelloWorld {   

 

    SimpleDateFormat sdf_ = new SimpleDateFormat();

 

    Date date_ = new Date();   

 

    public ProbedHelloWorld() throws Exception {

 

        Thread.sleep(1000);       

 

        Properties prop = System.getProperties();

 

        prop.list(System.out);               

 

        while (true) {

 

            callA(1000);

 

        }

 

    }  

 

 

    public void callA(long time) throws Exception {

 

        date_.setTime(System.currentTimeMillis());       

 

        System.out.println(sdf_.format(date_) + " Still running...");       

 

 

        Thread.sleep(time);

 

    }

 

    public static void main(String args[]) throws Exception {

 

        new ProbedHelloWorld();

 

    }

 

}

 

 2. Create a custom PBD: HW.pbd

TurnOn: MyCustomTracerGroup

 

SetFlag: MyCustomTracerGroup

 

IdentifyClassAs: ProbedHelloWorld MyCustomTracerGroup

 

IdentifyInheritedAs: ProbedHellowWorld MyCustomTracerGroup

 

TraceOneMethodOfClass: ProbedHelloWorld callA BackendMarker "{classname}|{method}"

 

 

 3. Add HW.pbd to the IntroscopeAgent.profile:

 

introscope.autoprobe.directivesFile=default-typical-legacy.pbl,hotdeploy,HW.pbd

 


4. Restart the JVM to instrument the backend metric.

 


5. See the result in the Investigator:

 

0.jpg

Additional Information:

 

 This document was created to help you with your customization. If any further help is needed related to this Knowledge Document, contact CA Professional Services.