On this page:
Notify the Agent of Events
ADRUM.report method and passing in an event tracker object.
|ADRUM.report(tracker: eventTracker);||Notifies the agent of an event.|
Report Virtual Pages
You are required to enable SPA2 monitoring to use the API below to manually report virtual pages for SPAs. These APIs will also work in non-SPAs if you enable SPA2 monitoring.
To report virtual pages, you mark the beginning and end of virtual pages with the methods below. Both methods are called from the
ADRUM object. See also Set Custom Virtual Page Names.
Used to set the label for the virtual page. This label will be displayed in the Controller UI.
The virtual page name must consist of a string of 760 or fewer alphanumeric characters.
If the string length exceeds 760 characters, the page name will not be set.
When set to true, you need to call
When set to
How the API Works
The steps below describe the process of manually reporting virtual pages with the API:
Start monitoring a virtual page by manually marking the beginning of the virtual page with
- A beacon with the set virtual page name is sent to the EUM Server. If
ADRUM.markVirtualPageEndto report the virtual page. If
manuallyMarkVPEndis set to
- You either call
Example of Reporting Virtual Pages
The Angular example below shows both ways to mark the beginning of a virtual page. The function
ADRUM.markVirtualPageBegin that uses the default requiring you to manually mark the end of the virtual page. The function allowJSAgentMarkVPEnd passes the value
Events are reported to the agent using event trackers. There are three different kinds of event trackers:
|Event Tracker||Enabled for SPA2 Monitoring?||Description|
|VPageView||No||Used to track the stages of a virtual page view.|
|Ajax||Yes||Used to track Ajax requests.|
|Error||Yes||Used to track errors.|
There are also two properties that are common to all tracker types:
Gets or sets a URL
Gets or sets a URL.
Gets or sets the parent event identifier
Gets or sets the parent event identifier.
The following is the page view load flow in SPA1 monitoring. You'll use the SPA1 monitoring API below to set timing marks to match the below workflow as closely as possible in your own single page app framework. For SPA2 monitoring, see Report Virtual Pages: SPA2 Monitoring to learn about the SPA2 APIs for manually reporting virtual pages.
Based on the marks you set, AppDynamics derives the following key timing metrics. Marks should be called in the order in which they occur in the flow. The following table describes which marks used to calculate each metric.
|Full Metric Name||Short Metric Name||How Calculated|
|End User Response Time|
(not used for waterfall UI)
|HTML Download Time||DDT|
|HTML Download and DOM Building Time||DRT|
|DOM Building Time||DPT|
|DOM Ready Time|
(used instead of PLT for waterfall UI)
Indicates when a virtual page starts. It automatically calls:
Indicates when a virtual page ends. It automatically calls:
Correlates the Ajax requests sent after this call with the virtual page view event. The last tracker calling this method wins.
This method is called automatically in the VPageView constructor. When a VPageView is created, the AJAX requests made after that call are automatically correlated to that VPageView. Use this separate call only when you want to set up manual correlation.
Stops correlating Ajax requests to the virtual page view event.
Use this separate call only when you wish to set up manual correlation.
|Setters||The default value for these is the time when the API is called.|
|Sets the view change start time.|
|Sets the view change end time.|
|Sets the view DOM loaded time.|
|Sets the XHR requests completed time.|
|Sets the view resources loaded time. This includes images, CSS files, and scripts.|
|Sets the virtual page start time.|
|Sets the virtual page end time.|
|Gets the view change start time.|
|Gets the view change end time.|
|Gets the view DOM loaded time.|
|Gets the XHR requests completed time.|
|Gets the view resources loaded time.|
|Gets the virtual page start time.|
Gets the virtual page end time.
|Property Setters/Getters||Call this without a parameter to get the value and with a parameter to set the value.|
|Gets or sets the method ("GET" or "POST") of the Ajax.|
|Timing Setters||The default value for these is the time when the API is called.|
|Sets the time the request is sent.|
|Sets First Byte Time.|
|Sets Response Available Time.|
|Sets the time the response is completely processed.|
|Gets the time the request was sent.|
|Gets First Byte Time.|
|Gets Response Available Time|
|Gets the time the response was completely processed.|
|Property Setters/Getters||Call these without a parameter to get the value and with a parameter to set the value.|
|Gets or sets the error message.|
|Gets or sets the line number of source code where the error happened.|
Correlate Ajax Requests
Ajax requests can be correlated to virtual page views automatically or manually. When you create a vPageView tracker,
startCorrelatingXhrs() is called automatically in the constructor, correlating any subsequent Ajax calls with that VPageView event. To set up manual correlation, call
stopCorrelatingXhrs() to stop the automatic process and then call
startCorrelatingXhrs() where you wish correlation to re-commence.
You can exclude certain Ajax calls from being monitored by configuring ADRUM itself Before you invoke the
adrum.js script at the top of your page, add lines similar to the following:
Or you can exclude certain Ajax calls using the
vPageView.stopCorrelatingXhrs() call, and then turn correlation back on with
vPageView.startCorrelatingXhrs(), as in the following: