0

I would like to achieve different set of TPS at different API calls within the single script.

Currently i am using stages, minIterationDuration and sleep function for think time. However using different set of think time at API level doesn't help in achieving various TPS. Already --rps parameter but which distributes tps evenly across the API's

Below is my sample code,

    export default function()
    {
        group("T01_API1", function1.function);  // Example: 50 TPS for API 1
        group("T02_API2", function2.function);sleep(2); // Example: 100 TPS for API 2
        group("T03_API3", function3.function);sleep(2); // Example: 20 TPS for API 3
    }

Stages:

{
       "minIterationDuration":"4s",
       "stages": [
              { "duration": "15s", "target":15}, // Ramp Up
              { "duration": "1h", "target":15}, // Steady State


           { "duration": "10s", "target": 0} // Ramp down 
    ]
}

Please note above is the sample code used, not the entire script and i can't execute multiple instances of K6 due to system limitation and were i need to control within the single script file. Let me know your thoughts

ArunPrasath
  • 153
  • 4
  • 17

1 Answers1

1

The new k6 v0.27.0 has arrival-rate executors (to set iterations per second, i.e. TPS), and supports multiple scenarios (and you can have different TPS in each one). See the examples in https://github.com/loadimpact/k6/releases/tag/v0.27.0 and https://k6.io/docs/using-k6/scenarios/

na--
  • 1,016
  • 7
  • 9
  • Example, if we have two scenario, will both the scenarios execute concurrently or sequently ? – ArunPrasath Sep 14 '20 at 06:02
  • They will execute concurrently. You can use the `startTime` property of each scenario to simulate sequential execution: https://k6.io/docs/using-k6/scenarios – na-- Sep 14 '20 at 19:43