Icon

02a_​Model_​stress_​testing - 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


Session 4 - Best Practices when Productionizing Data Science

Exercise 02a Model stress testing

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

    • Rule Engine 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 Rule Engine nodes (preconfigured)


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

Nodes

Extensions

Links