We always suggest creating comprehensive functional tests, and then scheduling those tests for two reasons. First, it’s a much better monitor of functional uptime. Second, it’s efficient to reuse existing tests. With that said, we understand that some customers just want a simple monitor that validates a 200 is returned, and the performance is acceptable. So, we will show you how here.
For those looking for a written step-by-step guide:
- Login to API Fortress
- Click Create New Test
- Name the test
- Click Compose on the far left of the test interstitial page
- When in the platform close the tutorial wizard, and then click the HTTP Console button on the left.
- Enter the API call and click Send.
- Click Generate test.
- Click ok on the first two options, but click Skip on the third (create assertions)
- The GET call should have been created for you. Now, click Code View at the top right.
- Paste this code below the GET call.
<assert-is expression="payload_response.statusCode='200'" type="integer"/> <assert-less expression="payload_response.metrics.latency" value="350"/> <assert-less expression="payload_response.metrics.fetch" value="300"/> <assert-less expression="payload_response.metrics.overall" value="650"/>
- If you look carefully you’ll see that is it straightforward. Confirm the status code is 200, and make sure the latency, fetch (download), and overall timing is below those numbers (in milliseconds). Those are numbers we suggest, but you should adjust as you see fit.
- Run the test to confirm it works.
- Save and Exit
- Click Publish
- Click Schedule
- Schedule as you see fit. We’d suggest at least the east and west coast every 5mins.
That’s it! Please let us know if you have any questions.