Icon

01 Stress test - Inference time - exercise

Model stress testflow. This workflow tests that the prediction workflow's inference time is within the expected time range. The test fails if returning the predictions takes more than 0.5 seconds.
Step 1. Configure the POST request to the deployed workflow

  1. Open the component and configure the POST request to the deployed workflow


Part 3 - Best practices

Exercise workflow 01 Stress test - Inference time

Learning objective: In this exercise you'll learn how to stress test the prediction workflow.


Workflows description: Model stress testflow. This workflow tests that the prediction workflow's inference time is within the expected time range. The test fails if returning the predictions takes more than 0.5 seconds.


You'll find the instructions to the exercises in the yellow annotations.

Step 3. Configure when testflow succeeds and when it fails

  1. Configure the Breakpoint node to halt the testflow execution if the test fails and to execute successfully if the test passes

    • Expression node returns the flow variable test_result

    • Enable breakpoint if the variable test_result matches the value failed

    • Optionally provide the custom message explaining the reason of failure


Step 2. Measure the time needed to receive the response from the POST request

  1. Use the Timer Info node

  2. Check whether the execution time of the JSON conversion & POST request component is longer than 0.3 seconds with the Row Filter and Expression nodes (preconfigured)


High number of simultaneous requests for predictions
Table Reader
POST request &JSON conversion
Row Filter
JSON conversion & POST request
Table Row to Variable
Test is passedif the time< 0.5 seconds
Expression

Nodes

Extensions

Links