Skip to content

Commit

Permalink
fix: fetch tests write to stats.xml, both ingest and fragmentation st…
Browse files Browse the repository at this point in the history
…atistics
  • Loading branch information
rorlic committed May 21, 2024
1 parent 8cd035a commit d0e5ba9
Show file tree
Hide file tree
Showing 7 changed files with 207 additions and 137 deletions.
44 changes: 27 additions & 17 deletions load-testing/server/fetch.1000mpp.jmx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
</collectionProp>
</HeaderManager>
<hashTree/>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Setup - create LDES">
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Setup - create LDES" enabled="true">
<stringProp name="HTTPSampler.path">/admin/api/v1/eventstreams</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<stringProp name="HTTPSampler.method">POST</stringProp>
Expand Down Expand Up @@ -132,7 +132,17 @@
</collectionProp>
</elementProp>
</HTTPSamplerProxy>
<hashTree/>
<hashTree>
<JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Set Start Time" enabled="true">
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="cacheKey">true</stringProp>
<stringProp name="script">vars.put(&quot;starttime&quot;, String.valueOf(System.currentTimeMillis()));
</stringProp>
</JSR223PostProcessor>
<hashTree/>
</hashTree>
<LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<stringProp name="LoopController.loops">${total_member_count}</stringProp>
</LoopController>
Expand Down Expand Up @@ -261,12 +271,12 @@ _:B56e84f09X2D89aeX2D4f0fX2Dbd18X2D80ec0e031082 &lt;http://www.w3.org/1999/02/22
<hashTree/>
</hashTree>
</hashTree>
<JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Fragmentation Start Time" enabled="true">
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
<JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Ingest End Time">
<stringProp name="cacheKey">true</stringProp>
<stringProp name="script">vars.put(&quot;fragmentation_starttime&quot;, String.valueOf(System.currentTimeMillis()))</stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="script">vars.put(&quot;ingest_endtime&quot;, String.valueOf(System.currentTimeMillis()));</stringProp>
<stringProp name="scriptLanguage">groovy</stringProp>
</JSR223PreProcessor>
<hashTree/>
<WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="While not last page exists" enabled="true">
Expand Down Expand Up @@ -439,21 +449,21 @@ _:B56e84f09X2D89aeX2D4f0fX2Dbd18X2D80ec0e031082 &lt;http://www.w3.org/1999/02/22
</ResultCollector>
<hashTree/>
</hashTree>
<JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Setup - Fragmentation result writer" enabled="true">
<JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Setup - Fragmentation result writer">
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="cacheKey">true</stringProp>
<stringProp name="script">log.info(&quot;starting fragmentation analysis&quot;);
log.info(&quot;start: &quot; + vars.get(&quot;fragmentation_starttime&quot;));
log.info(&quot;end: &quot; + vars.get(&quot;fragmentation_endtime&quot;));
<stringProp name="script">def start = vars.get(&quot;starttime&quot;) as long;
def ingest_end = vars.get(&quot;ingest_endtime&quot;) as long;
def fragmentation_end = vars.get(&quot;fragmentation_endtime&quot;) as long;

def start = vars.get(&quot;fragmentation_starttime&quot;) as long;
def end = vars.get(&quot;fragmentation_endtime&quot;) as long;
def time = end - start;
def perSecond = ${total_member_count} / time * 1000 as int;
def ingest_time = ingest_end - start;
def ingestedPerSecond = ${total_member_count} / ingest_time * 1000 as int;
def fragmentation_time = fragmentation_end - start;
def fragmentedPerSecond = ${total_member_count} / fragmentation_time * 1000 as int;

return &quot;\n\t\tFragmentation time: &quot; + time + &quot; ms (&quot; + perSecond + &quot; per second)&quot;;
return &quot;\n\t\tIngest time: &quot; + ingest_time + &quot; ms (&quot; + ingestedPerSecond + &quot; per second)&quot; + &quot;\n\t\tFragmentation time: &quot; + fragmentation_time + &quot; ms (&quot; + fragmentedPerSecond + &quot; per second)&quot;;
</stringProp>
</JSR223Sampler>
<hashTree>
Expand Down Expand Up @@ -485,7 +495,7 @@ return &quot;\n\t\tFragmentation time: &quot; + time + &quot; ms (&quot; + perSe
<assertionsResultsToSave>0</assertionsResultsToSave>
</value>
</objProp>
<stringProp name="filename">results/time_interval.xml</stringProp>
<stringProp name="filename">stats.xml</stringProp>
</ResultCollector>
<hashTree/>
</hashTree>
Expand Down
44 changes: 27 additions & 17 deletions load-testing/server/fetch.100mpp.jmx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<stringProp name="HTTPSampler.implementation">HttpClient4</stringProp>
</ConfigTestElement>
<hashTree/>
<SetupThreadGroup guiclass="SetupThreadGroupGui" testclass="SetupThreadGroup" testname="Setup" enabled="true">
<SetupThreadGroup guiclass="SetupThreadGroupGui" testclass="SetupThreadGroup" testname="Setup">
<intProp name="ThreadGroup.num_threads">1</intProp>
<boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
<stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
Expand Down Expand Up @@ -132,7 +132,17 @@
</collectionProp>
</elementProp>
</HTTPSamplerProxy>
<hashTree/>
<hashTree>
<JSR223PostProcessor guiclass="TestBeanGUI" testclass="JSR223PostProcessor" testname="Set Start Time">
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="cacheKey">true</stringProp>
<stringProp name="script">vars.put(&quot;starttime&quot;, String.valueOf(System.currentTimeMillis()));
</stringProp>
</JSR223PostProcessor>
<hashTree/>
</hashTree>
<LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
<stringProp name="LoopController.loops">${total_member_count}</stringProp>
</LoopController>
Expand Down Expand Up @@ -261,12 +271,12 @@ _:B56e84f09X2D89aeX2D4f0fX2Dbd18X2D80ec0e031082 &lt;http://www.w3.org/1999/02/22
<hashTree/>
</hashTree>
</hashTree>
<JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Fragmentation Start Time" enabled="true">
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
<JSR223PreProcessor guiclass="TestBeanGUI" testclass="JSR223PreProcessor" testname="Set Ingest End Time">
<stringProp name="cacheKey">true</stringProp>
<stringProp name="script">vars.put(&quot;fragmentation_starttime&quot;, String.valueOf(System.currentTimeMillis()))</stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="script">vars.put(&quot;ingest_endtime&quot;, String.valueOf(System.currentTimeMillis()));</stringProp>
<stringProp name="scriptLanguage">groovy</stringProp>
</JSR223PreProcessor>
<hashTree/>
<WhileController guiclass="WhileControllerGui" testclass="WhileController" testname="While not last page exists" enabled="true">
Expand Down Expand Up @@ -439,21 +449,21 @@ _:B56e84f09X2D89aeX2D4f0fX2Dbd18X2D80ec0e031082 &lt;http://www.w3.org/1999/02/22
</ResultCollector>
<hashTree/>
</hashTree>
<JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Setup - Fragmentation result writer" enabled="true">
<JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Setup - Fragmentation result writer">
<stringProp name="scriptLanguage">groovy</stringProp>
<stringProp name="parameters"></stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="cacheKey">true</stringProp>
<stringProp name="script">log.info(&quot;starting fragmentation analysis&quot;);
log.info(&quot;start: &quot; + vars.get(&quot;fragmentation_starttime&quot;));
log.info(&quot;end: &quot; + vars.get(&quot;fragmentation_endtime&quot;));
<stringProp name="script">def start = vars.get(&quot;starttime&quot;) as long;
def ingest_end = vars.get(&quot;ingest_endtime&quot;) as long;
def fragmentation_end = vars.get(&quot;fragmentation_endtime&quot;) as long;

def start = vars.get(&quot;fragmentation_starttime&quot;) as long;
def end = vars.get(&quot;fragmentation_endtime&quot;) as long;
def time = end - start;
def perSecond = ${total_member_count} / time * 1000 as int;
def ingest_time = ingest_end - start;
def ingestedPerSecond = ${total_member_count} / ingest_time * 1000 as int;
def fragmentation_time = fragmentation_end - start;
def fragmentedPerSecond = ${total_member_count} / fragmentation_time * 1000 as int;

return &quot;\n\t\tFragmentation time: &quot; + time + &quot; ms (&quot; + perSecond + &quot; per second)&quot;;
return &quot;\n\t\tIngest time: &quot; + ingest_time + &quot; ms (&quot; + ingestedPerSecond + &quot; per second)&quot; + &quot;\n\t\tFragmentation time: &quot; + fragmentation_time + &quot; ms (&quot; + fragmentedPerSecond + &quot; per second)&quot;;
</stringProp>
</JSR223Sampler>
<hashTree>
Expand Down Expand Up @@ -485,7 +495,7 @@ return &quot;\n\t\tFragmentation time: &quot; + time + &quot; ms (&quot; + perSe
<assertionsResultsToSave>0</assertionsResultsToSave>
</value>
</objProp>
<stringProp name="filename">results/time_interval.xml</stringProp>
<stringProp name="filename">stats.xml</stringProp>
</ResultCollector>
<hashTree/>
</hashTree>
Expand Down
Loading

0 comments on commit d0e5ba9

Please sign in to comment.