# Monitoring\_Test\_Script

### Monitoring created Test Scripts:

After saving your Monitored API on the form page, you can commence the monitoring process for your API.

***

### Contents

* [Start Monitoring.](#start-monitoring)
* [Metrics.](#metrics)
* [Stop Monitoring.](#stop-monitoring)

***

#### Start Monitoring:

Initiating monitoring for your API can be done by clicking the **Play** button. Once monitoring is active, the **Play** button transforms into a **Stop** button, and the **offline** icon is replaced with either a thumbs-up or a thumbs-down symbol, depending on whether the returned status code matches the expected status code. Additionally, a message will appear to inform the user that monitoring is in progress.

![Start Monitoring](https://1658030817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F69UIIR3YErzKiN7uLdZh%2Fuploads%2Fgit-blob-d2042de155200deb2e53b4c1113b811331d66f5b%2FStart_Monitiring_Test_Script.png?alt=media)

***

#### Metrics:

The status icon will display either a thumbs-up or thumbs-down to indicate whether the monitored API is returning the expected status code.

![Thumbs Up](https://1658030817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F69UIIR3YErzKiN7uLdZh%2Fuploads%2Fgit-blob-316de522d7f1258164b7290a1e5ff43e6beb0ee9%2FThumbs_up.png?alt=media)

![Thumbs Down](https://1658030817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F69UIIR3YErzKiN7uLdZh%2Fuploads%2Fgit-blob-c3c6e852de849b7a833b627a67cd87c9a4bb62eb%2FThumbs_Down.png?alt=media)

The status column will show an **Offline Cloud** Icon if the API is not under monitoring.

![Offine](https://1658030817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F69UIIR3YErzKiN7uLdZh%2Fuploads%2Fgit-blob-1e79d28228748df08412023f6a95b96f9c0f1e1d%2FOffline.png?alt=media)

To access metrics regarding your monitored API, simply click on the **Bar Graph** icon.

![Metric](https://1658030817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F69UIIR3YErzKiN7uLdZh%2Fuploads%2Fgit-blob-19c48cf8c1a2511cef7b142c508e8bc20a742940%2FMatrix_View_Test_Script.png?alt=media)

You will be listed with all matrics related to respective Script. As listed below:

* [Status Codes.](#status-codes)
* [Performance Index.](#performance-index)
* [Response Time Metrics.](#response-time-metrics)
* [Graph.](#graph)
* [Violations.](#violations)

#### Status Codes:

A status code in an API is a three-digit numerical code returned by the server to indicate the outcome of a client's request, such as success, error, or redirection.

![Status Code](https://1658030817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F69UIIR3YErzKiN7uLdZh%2Fuploads%2Fgit-blob-06c7b2793c6db8c0c0969085e70f47b1264d3540%2FStatus_Code.png?alt=media)

* **Current Status Code:** Represents the status code of your API during the most recent call.
* **Previous Status Code:** Reflects the status code of your API before the last call.

Adjacent to each status code, a thumbs-up or thumbs-down symbol indicates whether the monitored API is returning the expected status code when it's under monitoring. Otherwise, an offline cloud icon signifies that it is not being monitored.

#### Performance Index:

The Performance Index in API monitoring is a metric that assesses the overall performance and reliability of an API by considering various factors such as response times, error rates, and availability.

![Performance Index](https://1658030817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F69UIIR3YErzKiN7uLdZh%2Fuploads%2Fgit-blob-55594338ee2592012873c3a8e9cc455ee172b612%2FPerformance_Index.png?alt=media)

* **Success Count:** The count of instances where the monitored API delivered the anticipated status code.
* **Fail Count:** The count of instances where the monitored API did not produce the expected status code.
* **Total Number of Runs:** The overall count of times the monitored API was invoked.
* **Apdex:** The ratio of successful runs to the total number of runs (Success Count/Total Number of Runs).

#### Response Time Metrics:

Response Time Metrics in API monitoring refer to measurements that track the time it takes for an API to respond to a request, providing insights into its performance and efficiency.

![Response Time Matrix](https://1658030817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F69UIIR3YErzKiN7uLdZh%2Fuploads%2Fgit-blob-454738aa2ef0a101489d8231ca74837ff2c8f233%2FResponse_Time_Metric.png?alt=media)

* **Rolling Average Response Time (ms):** The mean response time across API calls
* **Last Response Time (ms):** Response time for the most recent API call
* **Shortest Response Time (ms):** Fastest completion time observed in monitored API requests
* **Longest Response Time (ms):** Longest completion time observed in monitored API requests"

#### Graph:

The graph displays both the Single and Average Response Time Thresholds, along with the Response Times of the ten most recent API calls.

![Graph](https://1658030817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F69UIIR3YErzKiN7uLdZh%2Fuploads%2Fgit-blob-04860a319c3d9b5868530777fe75d29cbec246f3%2FGraph.png?alt=media)

#### Violations:

Violations in API monitoring refer to instances when the monitored API fails to meet specified performance or behavior criteria, such as response time or status code.

![Violations](https://1658030817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F69UIIR3YErzKiN7uLdZh%2Fuploads%2Fgit-blob-4293d0be62cc3aee6f8450bb15db807d8d045668%2FViolations.png?alt=media)

* **Violations for Average Response Time:** Indicates how frequently the rolling average response time surpasses the defined threshold for average response time.
* **Violations for Response Time:** Indicates the frequency of instances when the response time of an API call exceeds the specified threshold for a single response time.

***

#### Stop Monitoring:

To conclude monitoring for the API, simply click the **Stop** button. You will receive a message confirming the cessation of API monitoring. The **Stop** button will revert to **Play**, and the thumbs-up or thumbs-down icon will transition back to the **offline** status.

![Stop Monitoring](https://1658030817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F69UIIR3YErzKiN7uLdZh%2Fuploads%2Fgit-blob-6fe92e680e869731f77a8f8441b170f8eb24b80d%2FStop_Monitoring.png?alt=media)

### [Overview](https://docs.qyrus.com/api-monitoring/readme)
