Skip to content

Commit

Permalink
adding a new demo project definition
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Grabner <[email protected]>
  • Loading branch information
grabnerandi committed Jun 24, 2021
1 parent 7a891ff commit a7ee302
Show file tree
Hide file tree
Showing 26 changed files with 1,551 additions and 1 deletion.
5 changes: 4 additions & 1 deletion keptn_project_templates/quality-gate-dynatrace/shipyard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ spec:
- name: evaluation
tasks:
- name: monaco
- name: evaluation
- name: evaluation
- name: simple_evaluation
tasks:
- name: evaluation
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
spec_version: '0.1.0'
dashboard: query
attachRules:
tagRule:
- meTypes:
- PROCESS_GROUP_INSTANCE
tags:
- context: CONTEXTLESS
key: keptn_project
value: $PROJECT
- context: CONTEXTLESS
key: keptn_service
value: $SERVICE
- context: CONTEXTLESS
key: keptn_stage
value: $STAGE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
projects:
- simplenode
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.1.1 r1855137">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Testing Sample NodeJs" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="TestPlan.functional_mode">false</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 name="SERVER_URL" elementType="Argument">
<stringProp name="Argument.name">SERVER_URL</stringProp>
<stringProp name="Argument.value"></stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="CHECK_PATH" elementType="Argument">
<stringProp name="Argument.name">CHECK_PATH</stringProp>
<stringProp name="Argument.value">/</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="DT_LTN" elementType="Argument">
<stringProp name="Argument.name">DT_LTN</stringProp>
<stringProp name="Argument.value">Default</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="DefaultThinkTime" elementType="Argument">
<stringProp name="Argument.name">DefaultThinkTime</stringProp>
<stringProp name="Argument.value">250</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="PROTOCOL" elementType="Argument">
<stringProp name="Argument.name">PROTOCOL</stringProp>
<stringProp name="Argument.value">http</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="VUCount" elementType="Argument">
<stringProp name="Argument.name">VUCount</stringProp>
<stringProp name="Argument.value">1</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
<elementProp name="LoopCount" elementType="Argument">
<stringProp name="Argument.name">LoopCount</stringProp>
<stringProp name="Argument.value">1</stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="TestPlan.user_define_classpath"></stringProp>
</TestPlan>
<hashTree>
<ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="BasicThreadGroup" enabled="true">
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
<elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">${__P(LoopCount,${LoopCount})}</stringProp>
</elementProp>
<stringProp name="ThreadGroup.num_threads">${__P(VUCount,${VUCount})}</stringProp>
<stringProp name="ThreadGroup.ramp_time">1</stringProp>
<longProp name="ThreadGroup.start_time">1444323045000</longProp>
<longProp name="ThreadGroup.end_time">1444323045000</longProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup>
<hashTree>
<CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true">
<collectionProp name="CookieManager.cookies"/>
<boolProp name="CookieManager.clearEachIteration">false</boolProp>
</CookieManager>
<hashTree/>
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
<collectionProp name="HeaderManager.headers"/>
</HeaderManager>
<hashTree/>
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="Set Dynatrace Headers" enabled="true">
<boolProp name="resetInterpreter">true</boolProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="script">import org.apache.jmeter.util.JMeterUtils;
import org.apache.jmeter.protocol.http.control.HeaderManager;
import java.io;
import java.util;

// -------------------------------------------------------------------------------------
// Generate the x-dynatrace-test header based on this best practic
// -&gt; https://www.dynatrace.com/support/help/integrations/test-automation-frameworks/how-do-i-integrate-dynatrace-into-my-load-testing-process/
// -------------------------------------------------------------------------------------
String LTN=JMeterUtils.getProperty(&quot;DT_LTN&quot;);
if((LTN == null) || (LTN.length() == 0)) {
if(vars != null) {
LTN = vars.get(&quot;DT_LTN&quot;);
}
}
if(LTN == null) LTN = &quot;NoTestName&quot;;

String LSN = (bsh.args.length &gt; 0) ? bsh.args[0] : &quot;Test Scenario&quot;;
String TSN = sampler.getName();
String VU = ctx.getThreadGroup().getName() + ctx.getThreadNum();
String headerValue = &quot;LSN=&quot;+ LSN + &quot;;TSN=&quot; + TSN + &quot;;LTN=&quot; + LTN + &quot;;VU=&quot; + VU + &quot;;&quot;;

// -------------------------------------------
// Set header
// -------------------------------------------
HeaderManager hm = sampler.getHeaderManager();
hm.removeHeaderNamed(&quot;x-dynatrace-test&quot;);
hm.add(new org.apache.jmeter.protocol.http.control.Header(&quot;x-dynatrace-test&quot;, headerValue));</stringProp>
</BeanShellPreProcessor>
<hashTree/>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Basic Check" enabled="true">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">${__P(SERVER_URL,${SERVER_URL})}</stringProp>
<stringProp name="HTTPSampler.port">${__P(SERVER_PORT,${SERVER_PORT})}</stringProp>
<stringProp name="HTTPSampler.protocol">${__P(PROTOCOL,${PROTOCOL})}</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">${__P(CHECK_PATH,${CHECK_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>
<HeaderManager guiclass="HeaderPanel" testclass="HeaderManager" testname="HTTP Header Manager" enabled="true">
<collectionProp name="HeaderManager.headers"/>
</HeaderManager>
<hashTree/>
</hashTree>
<ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Default Think Time" enabled="true">
<stringProp name="ConstantTimer.delay">{__P(ThinkTime,${DefaultThinkTime})}</stringProp>
</ConstantTimer>
<hashTree/>
</hashTree>
<ResultCollector guiclass="SummaryReport" testclass="ResultCollector" testname="Summary Report" enabled="true">
<boolProp name="ResultCollector.error_logging">false</boolProp>
<objProp>
<name>saveConfig</name>
<value class="SampleSaveConfiguration">
<time>true</time>
<latency>true</latency>
<timestamp>true</timestamp>
<success>true</success>
<label>true</label>
<code>true</code>
<message>true</message>
<threadName>true</threadName>
<dataType>true</dataType>
<encoding>false</encoding>
<assertions>true</assertions>
<subresults>true</subresults>
<responseData>false</responseData>
<samplerData>false</samplerData>
<xml>false</xml>
<fieldNames>false</fieldNames>
<responseHeaders>false</responseHeaders>
<requestHeaders>false</requestHeaders>
<responseDataOnError>false</responseDataOnError>
<saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
<assertionsResultsToSave>0</assertionsResultsToSave>
<bytes>true</bytes>
<threadCounts>true</threadCounts>
</value>
</objProp>
<stringProp name="filename"></stringProp>
</ResultCollector>
<hashTree/>
</hashTree>
</hashTree>
</jmeterTestPlan>
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
spec_version: '0.1.0'
workloads:
- teststrategy: performance_long
vuser: 10
loopcount: 2000
thinktime: 250
acceptederrorrate: 1.0
script: jmeter/load.jmx
- teststrategy: performance_100
vuser: 100
loopcount: 10
thinktime: 250
acceptederrorrate: 1.0
script: jmeter/load.jmx
- teststrategy: performance_50
vuser: 50
loopcount: 10
thinktime: 250
acceptederrorrate: 1.0
script: jmeter/load.jmx
- teststrategy: performance_10
vuser: 50
loopcount: 10
thinktime: 250
acceptederrorrate: 1.0
script: jmeter/load.jmx
- teststrategy: performance_quick
vuser: 10
loopcount: 100
thinktime: 250
acceptederrorrate: 1.0
script: jmeter/load.jmx
- teststrategy: performance_peak
vuser: 10
loopcount: 500
thinktime: 250
acceptederrorrate: 1.0
script: jmeter/load.jmx
- teststrategy: performance
vuser: 10
loopcount: 100
thinktime: 250
acceptederrorrate: 1.0
script: jmeter/load.jmx
Loading

0 comments on commit a7ee302

Please sign in to comment.