Track Calls
You can instrument methods to see how often the instrumented a method is invoked and how long it takes to run. To do this, add a call at the beginning and end of the method you'd like to instrument.
In the example below, the code executed in the constructor for the class ShoppingCart will be tracked and reported. In your own code, start tracking calls by specifying the class and method in BeginCall and then complete the tracking and report the data by calling ReportCallEnded.
using AppDynamics.Agent;
...
public class ShoppingCart {
public ShoppingCart() {
// Code to create the shopping cart
}
void CheckOut(int custId, int transactionId) {
var tracker = Instrumentation.BeginCall("ShoppingCart", "CheckOut", custId, transactionId);
// The code placed here will be tracked and reported.
tracker.ReportCallEnded();
}
}