Lesson Summary

A really nice feature in GenRocket is the ability to chain multiple Scenarios together to run consecutively as one Scenario, thus saving the time it takes to run on Scenario after another or having to write a script to perform the same action.


In this lesson, we will create to Scenario Chains

  • InsertScenarioChain - Chain the three insert Scenarios to run together
  • UpdateScenarioChain - Chain the three update Scenarios to run together


Lesson Steps

Step 1 - Creating the InsertScenarioChain

  • On the Project Dashboard, go to the Scenario Chains panel
  • Click the New Scenario Chain button


Step 2 - Name the Scenario Chain

  • Set the name parameter to Insert
  • Set the description text to
    • Combines the three insert Scenarios into one insert Scenario.
  • Click the Save button


Step 3 - Add Scenarios into the Scenario Chain

  • Within the Scenarios list, click the + icon in the following sequence
    1. UserInsertScenario
    2. GrantHistoryScenanrio
    3. NotificationHistoryScenario


Step 4 - Download and Run the InsertScenarioChain

  • Click the Download button
  • Make sure you run the proper commands to empty the tables in both the alpha and beta databases.
  • Open up a command line terminal
  • Run the following command
    • genrocket -r InsertScenarioChain.grs


You should see console output similar to the following


> ~/Downloads: genrocket -r InsertScenarioChain.grs 
License validated
GenRocket Runtime Version: 3.5.6
GenRocket Generator Runtime Version: 3.5.6.7
GenRocket Receiver Runtime Version: 3.5.6.2
Validating the Scenario Checksum for Integrity.
Starting Engine...
Running Scenario UserInsertScenario...
Preparing Statement: insert into alpha.user(id,external_id,first_name,last_name,middle_initial,username,ssn,password,activation_date) values (?,?,?,?,?,?,?,?,?)
Insert Count = 10000...
Insert Count = 20000...
Insert Count = 30000...
Insert Count = 40000...
Insert Count = 50000...
Running Scenario GrantHistoryInsertScenario...
Preparing Statement: insert into beta.grant_history(id,granter_id,first_name,last_name,username,status,credit_card,card_type,grant_date,grant_amount) values (?,?,?,?,?,?,?,?,?,?)
Insert Count = 60000...
Insert Count = 70000...
Insert Count = 80000...
Insert Count = 90000...
Insert Count = 100000...
Running Scenario NotificationSettingInsertScenario...
Preparing Statement: insert into beta.notification_setting(id,user_external_id,username,frequency_count,frequency_type,hit_rate,failure_rate) values (?,?,?,?,?,?,?)
Insert Count = 110000...
Insert Count = 120000...
Insert Count = 130000...
Insert Count = 140000...
Insert Count = 150000...
All done! Time elapsed: 0m:43s


Step 5 - Creating the UpateScenarioChain

  • Name the Scenario Chaing, Update
  • Follow steps 1 through 4


After you run your UpdateScenarioChain, you should see console output similar to the following


> ~/Downloads: genrocket -r UpdateScenarioChain.grs 
License validated
GenRocket Runtime Version: 3.5.6
GenRocket Generator Runtime Version: 3.5.6.7
GenRocket Receiver Runtime Version: 3.5.6.2
Validating the Scenario Checksum for Integrity.
Starting Engine...
Running Scenario UserUpdateScenario...
Update Count = 10000...
Update Count = 20000...
Update Count = 30000...
Update Count = 40000...
Update Count = 50000...
Running Scenario GrantHistoryUpdateScenario...
Update Count = 10000...
Update Count = 20000...
Update Count = 30000...
Update Count = 40000...
Update Count = 50000...
Running Scenario NotificationSettingUpdateScenario...
Update Count = 10000...
Update Count = 20000...
Update Count = 30000...
Update Count = 40000...
Update Count = 50000...
All done! Time elapsed: 0m:48s

 

Congratulations for completing all of the lessons in this POC!