Skip to content

Instantly share code, notes, and snippets.

@adr0sen
adr0sen / load_impact_web_load_testing_sample.lua
Created March 30, 2017 23:32
Load Impact Lua script sample: Advanced login w dynamic data extraction/correlation
-- For more details, see http://support.loadimpact.com/knowledgebase/articles/389413-advanced-login-w-dynamic-data-extraction-correlati
--
-- Dynamic data correlation/extraction example user scenario
--
-- This user scenario code demonstrates how to look for certain data in an HTTP response
-- using regular expression matching. The extracted data can then be used in future requests,
-- typically to simulate CSRF (cross-site request forgery) tokens, session keys or similar
-- dynamic data the server wants included in requests for security or other reasons.
--
@adr0sen
adr0sen / load_impact_api_load_testing_sample.lua
Last active March 23, 2017 19:25
Load Impact sample - How to load test an API
-- For more details, see: http://support.loadimpact.com/knowledgebase/articles/861396-how-to-load-test-an-api
-- This script takes a URL as input, and attempts to generate a steady flow
-- of 25 requests per second, RPS. Dividing your target RPS by 25 while using this
-- script as the user scenario(s), you will know the number of required VUs to
-- model in your test configuration.
-- What URL are we looking to hit in this test
local url = "http://109.228.153.2/style.css"