Legacy Documentation
You're viewing legacy documentation for API Fortress (deployed via an on-premises container). To view documentation for the new SaaS version of API Fortress — now known as Sauce Labs API Testing and Monitoring (with Sauce Connect tunnels) — see API Testing on the Sauce Labs Cloud.

19. Easy Monitoring

We suggest creating comprehensive functional tests, and then scheduling those tests as monitors for two reasons. First, this method ensures that your monitors validate functional uptime rather than a simple 200 OK ping. Second, this approach makes it efficient to reuse existing tests. However, we understand that you may simply be looking for a simple monitor that validates that the 200 OK is returned, and performance is acceptable.

Follow these steps to quickly create a basic monitor:
  1. Login to API Fortress
  2. Click Create New Test
  3. Name the test
  4. Click Compose on the far left of the test interstitial page
  5. On the platform, close the tutorial wizard and then click the HTTP Console button on the left
  6. Enter the API call and click Send
  7. Click Generate Test
  8. Click OK on the first two options, but click Skip on the third (“Create Assertions”)
  9. The GET call should have been created for you. Now, click Code View at the top right.
  10. Paste this code below the GET call:
    <assert-is expression="payload_response.statusCode=&apos;200&apos;" 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"/>
  11. Confirm that 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.
  12. Run the test to confirm it works.
  13. Save and Exit
  14. Click Publish
  15. Click Schedule
  16. Schedule as you see fit.
Thank you for learning how to use API Fortress in our Quick Start Guide. Please let us know if you have any questions or comments.