Retrieving synthetic execution data and metrics
Use the GET method to retrieve execution data and metrics, for the most recent execution or historic executions, of a single Execution Plan or all of your Execution Plans.
Before you begin
You must obtain an authToken by using the login API. The token authenticates the user performing the operation. For details, see TSWS authentication.
To retrieve synthetic execution data
Use the following request syntax for the getLatest and getHistorical APIs:
For retrieving the most recent execution data | https://<PresentationServerHostName>/tsws/10.0/api/appvis/synthetic/api/data/getLatest?applicationId=<AID>&executionPlanId=<EPID>&locationId=<LID>&withErrors=<E>&withCustomTimers=<CT>&withPageTimers=<PT> |
For retrieving historic execution data | https://<PresentationServerHostName>/tsws/10.0/api/appvis/synthetic/api/data/getHistorical?applicationId=<AID>&executionPlanId=<EPID>&locationId=<LID>&withErrors=<E>&withCustomTimers=<CT>&withPageTimers=<PT>&fromEndTime=<FET>&toEndTime=<TET> |
In the above examples:
- <PresentationServerHostName> indicates the host name of the TrueSight Presentation Server.
- <AID> indicates the ID of the application on the Presentation Server (not the synthetic application ID).
- <EPID> indicates the ID of the Execution Plan.
- <LID> indicates the ID of the location.
- <E> indicates whether to include errors.
- <CT> indicates whether to include custom timers.
- <PT> indicates whether to include page timers.
- <FET> indicates from what end time to include data. (Historic data only)
- <TET> indicates until what end time to include data. (Historic data only)
Sample request with REST client
After accessing the REST client, perform the following steps:
Enter the URL for the API.
An example of a request for a historic transaction data is:https://localhost/tsws/10.0/api/appvis/synthetic/api/data/getHistorical?applicationId=1&executionPlanId=101&locationId=2&withErrors=false&withCustomTimers=false&withPageTimers=false&fromEndTime=1455019883851&toEndTime=1455623288778
- Add a new header row and select Authorization as the header type.
- Enter the text authToken followed by the authToken generated through the login API.
- Click Send.
Request parameters
Element | Description |
---|---|
authToken | Value of authToken |
Query parameters | |
applicationId | (Optional) ID of the application on the Presentation Server (not the synthetic application ID) If this parameter is not used, data is generated for all applications. |
executionPlanId | ( Optional ) ID of the Execution Plan If this parameter is not used, data is generated for all Execution Plans. |
locationId | ( Optional ) ID of the location If this parameter is not used, data is generated for all locations. |
withErrors | ( Optional ) Boolean value indicating if errors are included in the generated data. If this parameter is not used, errors are not included. |
withCustomTimers | ( Optional ) Boolean value indicating if custom timers are included in the generated data.If this parameter is not used, custom timers are not included. |
withPageTimers | ( Optional ) Boolean value indicating if page timers are included in the generated data.If this parameter is not used, page timers are not included. |
fromEndTime | ( Optional ) ( getHistorical API only ) Time value in UTC format indicating that transactions that ended after this end time are included in the data. If this parameter is not used, all available results until toEndTime are included. |
toEndTime | (Optional) ( getHistorical API only) Time value in UTC format indicating that transactions that ended up to and including this end time are included in the data. If this parameter is not used, all available results ending after fromEndTime are included. |
Response
The following JSON is a sample of the code returned by the API for a request for historic data.
"data": {
"transactions": [{
"executionPlanId": 101,
"agentId": 2,
"scriptExecutionErrorsCount": 0,
"groupId": 2,
"agentName": "MyAgent",
"availabilityErrorsCount": 0,
"executionErrorsCount": 0,
"customTimers": {
"timers": [{
"name": "Sv_ICMP Ping",
"type": "",
"value": 6
}]
},
"transactionName": "Ping",
"transactionId": 1,
"agentIp": "127.0.0.1",
"uid": "2-101-1455624188859",
"transactionStartTime": 1455624188859,
"pageTimers": null,
"groupName": "Location1",
"executionPlanStartTime": 1455624188859,
"transactionEndTime": 1455624188874,
"scriptName": "Pinger",
"accuracyErrorsCount": 0,
"agentMacAddress": "000000000000",
"syntheticApplicationId": 1,
"errors": null
},
{
"executionPlanId": 101,
"agentId": 2,
"scriptExecutionErrorsCount": 0,
"groupId": 2,
"agentName": "MyAgent",
"availabilityErrorsCount": 0,
"executionErrorsCount": 0,
"customTimers": {
"timers": [{
"name": "Sv_ICMP Ping",
"type": "",
"value": 6
}]
},
"transactionName": "Ping",
"transactionId": 1,
"agentIp": "127.0.0.1",
"uid": "2-101-1455623888830",
"transactionStartTime": 1455623888830,
"pageTimers": null,
"groupName": "Location1",
"executionPlanStartTime": 1455623888830,
"transactionEndTime": 1455623888846,
"scriptName": "Pinger",
"accuracyErrorsCount": 0,
"agentMacAddress": "000000000000",
"syntheticApplicationId": 1,
"errors": null
},
{
"executionPlanId": 101,
"agentId": 2,
"scriptExecutionErrorsCount": 0,
"groupId": 2,
"agentName": "MyAgent",
"availabilityErrorsCount": 0,
"executionErrorsCount": 0,
"customTimers": {
"timers": [{
"name": "Sv_ICMP Ping",
"type": "",
"value": 2
}]
},
"transactionName": "Ping",
"transactionId": 1,
"agentIp": "127.0.0.1",
"uid": "2-101-1455623588800",
"transactionStartTime": 1455623588800,
"pageTimers": null,
"groupName": "Location1",
"executionPlanStartTime": 1455623588800,
"transactionEndTime": 1455623588806,
"scriptName": "Pinger",
"accuracyErrorsCount": 0,
"agentMacAddress": "000000000000",
"syntheticApplicationId": 1,
"errors": null
},
{
"executionPlanId": 101,
"agentId": 2,
"scriptExecutionErrorsCount": 0,
"groupId": 2,
"agentName": "MyAgent",
"availabilityErrorsCount": 0,
"executionErrorsCount": 0,
"customTimers": {
"timers": [{
"name": "Sv_ICMP Ping",
"type": "",
"value": 1
}]
},
"transactionName": "Ping",
"transactionId": 1,
"agentIp": "127.0.0.1",
"uid": "2-101-1455623288774",
"transactionStartTime": 1455623288774,
"pageTimers": null,
"groupName": "Location1",
"executionPlanStartTime": 1455623288774,
"transactionEndTime": 1455623288778,
"scriptName": "Pinger",
"accuracyErrorsCount": 0,
"agentMacAddress": "000000000000",
"syntheticApplicationId": 1,
"errors": {
"errors": [3]
0:{
"severity": "ERROR"
"errorMessage": "WebPageUrl(WebEngine: 71 - Html verification, "flower" appeared 0 times - verification (>0) failed)"
"errorCode": "3"
"type": "accuracy"
}
1:{
"severity": "ERROR"
"errorMessage": "WebPageUrl(WebEngine: 71 - Html verification, "trx" appeared 6 times - verification (<1) failed)"
"errorCode": "3"
"type": "accuracy"
}
} ]
}
}
Response body parameters
Parameter | Description | Value |
---|---|---|
transactions | Can be multiple |
|
executionPlanId | ID of the Execution Plan | Number |
agentId | ID of the TEA Agent where the execution ran | Number |
scriptExecutionErrorsCount | Total number of errors that occurred during this transaction | Number |
groupId | ID of the location of the TEA Agent | Number |
agentName | Name of the TEA Agent where the execution ran | String |
availabilityErrorsCount | Number of availability errors that occurred during this transaction | Number |
executionErrorsCount | Number of execution errors that occurred during this transaction | Number |
customTimers | Custom timers for this execution |
|
timers | Can be multiple |
|
name | Name of the custom timer | String
|
value | Time in milliseconds | Number |
transactionName | Name of the transaction | String |
transactionId | Id of the transaction | Number |
agentIp | IP address of the TEA Agent | IP address |
uid | Unique ID of the execution If the execution includes more than one transaction, all transactions in that execution have the same value for uid. | String made up of the following: <agentId>-<executionPlanId>-<executionStartTime> |
transactionStartTime | Start time of the transaction in UTC format | Number |
pageTimers | Page timers for this execution |
|
timers | Can be multiple |
|
name | Name of the page timer | String
|
value | Time in milliseconds | Number |
groupName | Name of the location of the TEA Agent | String |
executionPlanStartTime | Start time of the execution in UTC format | Number |
transactionEndTime | End time of the transaction in UTC format | Number |
scriptName | Name of the script | String |
accuracyErrorsCount | Number of accuracy errors that occurred during this transaction | Number |
agentMacAddress | MAC address of the computer where the TEA Agent is installed | MAC address |
syntheticApplicationId | ID of the application for synthetic monitoring | number |
errors |
|
|
severity | Indication of the severity of the event | ERROR |
errorMessage | Error message returned by the application | String |
errorCode | Code indicating the type of error Correlates with type parameter | Number |
type | Type of error |
execution errors and script_execution errors are grouped together as execution errors in the user interface. |