Skip to content

Instantly share code, notes, and snippets.

@robingustafsson
Created January 30, 2019 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robingustafsson/e13dd7d2dd7a560dafda4e9b2cf36239 to your computer and use it in GitHub Desktop.
Save robingustafsson/e13dd7d2dd7a560dafda4e9b2cf36239 to your computer and use it in GitHub Desktop.
JMeter-to-k6 PR review: Stepping Thread Group (review 2)
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.0 r1840935">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="jmeter-to-k6-stepping-thread-group" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</boolProp>
<boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
<boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
<elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<kg.apc.jmeter.threads.SteppingThreadGroup guiclass="kg.apc.jmeter.threads.SteppingThreadGroupGui" testclass="kg.apc.jmeter.threads.SteppingThreadGroup" testname="jp@gc - Stepping Thread Group" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<stringProp name="ThreadGroup.num_threads">100</stringProp>
<stringProp name="Threads initial delay">0</stringProp>
<stringProp name="Start users count">10</stringProp>
<stringProp name="Start users count burst">0</stringProp>
<stringProp name="Start users period">30</stringProp>
<stringProp name="Stop users count">5</stringProp>
<stringProp name="Stop users period">1</stringProp>
<stringProp name="flighttime">60</stringProp>
<stringProp name="rampUp">5</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<intProp name="LoopController.loops">-1</intProp>
</elementProp>
</kg.apc.jmeter.threads.SteppingThreadGroup>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="HTTP Request" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">test.loadimpact.com</stringProp>
<stringProp name="HTTPSampler.port"></stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path"></stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
</HTTPSamplerProxy>
<hashTree/>
<ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true">
<stringProp name="ConstantTimer.delay">1000</stringProp>
</ConstantTimer>
<hashTree/>
</hashTree>
</hashTree>
</hashTree>
</jmeterTestPlan>
import http from "k6/http"
import { check, sleep } from "k6"
let url, opts, r
export let options = {
stages: [
{ target: 10, duration: "5s" },
{ target: 10, duration: "30s" },
{ target: 20, duration: "5s" },
{ target: 20, duration: "30s" },
{ target: 30, duration: "5s" },
{ target: 30, duration: "30s" },
{ target: 40, duration: "5s" },
{ target: 40, duration: "30s" },
{ target: 50, duration: "5s" },
{ target: 50, duration: "30s" },
{ target: 60, duration: "5s" },
{ target: 60, duration: "30s" },
{ target: 70, duration: "5s" },
{ target: 70, duration: "30s" },
{ target: 80, duration: "5s" },
{ target: 80, duration: "30s" },
{ target: 90, duration: "5s" },
{ target: 90, duration: "30s" },
{ target: 100, duration: "5s" },
{ target: 100, duration: "60s" },
{ target: 95, duration: "0s" },
{ target: 95, duration: "1s" },
{ target: 90, duration: "0s" },
{ target: 90, duration: "1s" },
{ target: 85, duration: "0s" },
{ target: 85, duration: "1s" },
{ target: 80, duration: "0s" },
{ target: 80, duration: "1s" },
{ target: 75, duration: "0s" },
{ target: 75, duration: "1s" },
{ target: 70, duration: "0s" },
{ target: 70, duration: "1s" },
{ target: 65, duration: "0s" },
{ target: 65, duration: "1s" },
{ target: 60, duration: "0s" },
{ target: 60, duration: "1s" },
{ target: 55, duration: "0s" },
{ target: 55, duration: "1s" },
{ target: 50, duration: "0s" },
{ target: 50, duration: "1s" },
{ target: 45, duration: "0s" },
{ target: 45, duration: "1s" },
{ target: 40, duration: "0s" },
{ target: 40, duration: "1s" },
{ target: 35, duration: "0s" },
{ target: 35, duration: "1s" },
{ target: 30, duration: "0s" },
{ target: 30, duration: "1s" },
{ target: 25, duration: "0s" },
{ target: 25, duration: "1s" },
{ target: 20, duration: "0s" },
{ target: 20, duration: "1s" },
{ target: 15, duration: "0s" },
{ target: 15, duration: "1s" },
{ target: 10, duration: "0s" },
{ target: 10, duration: "1s" },
{ target: 5, duration: "0s" },
{ target: 5, duration: "1s" },
{ target: 0, duration: "0s" }
]
}
export default function(data) {
url = "http://test.loadimpact.com"
opts = {
redirects: 999
}
r = http.request("GET", url, "", opts)
sleep(1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment