jmeter icon indicating copy to clipboard operation
jmeter copied to clipboard

Jmeter report doesnt created

Open mohamed-atef2022 opened this issue 1 year ago • 12 comments

i am trying to run jmeter through argowork flow , the flow is working fine here is the logs and the reports is created empty without any data , i am tried many options but cant solve it `` 024-08-06 13:44:09,121 ERROR o.a.j.JMeter: Error in NonGUIDriver java.lang.IllegalArgumentException: Results file:/report/zuhauseplus_debug_test.jmx_2024-08-06_134252.jtl is not empty at org.apache.jmeter.report.dashboard.ReportGenerator.(ReportGenerator.java:140) ~[ApacheJMeter_core.jar:5.6.3] at org.apache.jmeter.JMeter.runNonGui(JMeter.java:1007) [ApacheJMeter_core.jar:5.6.3] at org.apache.jmeter.JMeter.startNonGui(JMeter.java:940) [ApacheJMeter_core.jar:5.6.3] at org.apache.jmeter.JMeter.start(JMeter.java:508) [ApacheJMeter_core.jar:5.6.3] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at org.apache.jmeter.NewDriver.main(NewDriver.java:259)

mohamed-atef2022 avatar Aug 06 '24 10:08 mohamed-atef2022

add jmeter arg -f

linvaux avatar Aug 08 '24 01:08 linvaux

this is th code i use in which line i should edit if [ -n "${enable_report}" ]; then # report_command_line="--reportatendofloadtests --reportoutputfolder /report/report-${jmx}-$(date +"%F_%H%M%S")" report_command_line="--reportatendofloadtests --reportoutputfolder /report/report-${jmx}-{{workflow.creationTimestamp}}" fi

kubectl cp -c jmmaster "/tmp/scenario.properties" -n "${namespace}" "${master_pod}:/tmp/scenario.properties"

shellcheck disable=SC2145

echo "slave_array=(${slave_array[@]}); index=${slave_num} && while [ ${index} -gt 0 ]; do for slave in ${slave_array[@]}; do if echo 'test open port' 2>/dev/null > /dev/tcp/${slave}/1099; then echo ${slave}' ready' && slave_array=(${slave_array[@]/${slave}/}); index=$((index-1)); else echo ${slave}' not ready'; fi; done; echo 'Waiting for slave readiness'; sleep 2; done" >"/tmp/load_test.sh" { echo "cd /opt/jmeter/apache-jmeter/bin" echo "timeout ${duration}s jmeter ${param_user} ${param_properties} ${report_command_line} --logfile /report/${jmx}$(date +"%F%H%M%S").jtl --nongui --testfile ${jmx} -Dserver.rmi.ssl.disable=true --remoteexit --remotestart ${slave_list} >> jmeter-master.out 2>> jmeter-master.err" echo "jmeter -G ${param_user} ${param_properties} ${report_command_line} --logfile /report/${jmx}$(date +"%F%H%M%S").jtl --nongui --testfile ${jmx} -Dserver.rmi.ssl.disable=true --remoteexit --remotestart ${slave_list} >> jmeter-master.out 2>> jmeter-master.err &" echo "trap 'sleep 15 && kill -10 1' EXIT INT TERM" echo "java -jar /opt/jmeter/apache-jmeter/lib/jolokia-java-agent.jar start JMeter >> jmeter-master.out 2>> jmeter-master.err" echo "echo "Starting load test at : $(date)" "

mohamed-atef2022 avatar Aug 09 '24 13:08 mohamed-atef2022

The error message wants to tell you, that the sample log file already exists and is not empty.

To fix this, discard the file (save it somewhere?) before starting the test run.

Maybe workflow.creationTimestamp is constant relative to all your test runs?

PS. Why do you use so much "echo 'some shell code'" that seems quite unreadable to me. And instead of disabling a shell-check rule, try to fix the code.

FSchumacher avatar Aug 10 '24 12:08 FSchumacher

@mohamed-atef2022 Why you show some shell code? you could add jmeter arg -f to delete logfile before rerun test, such as

jmeter -n -t script.jmx -l result.jtl -e -o ./report -f

linvaux avatar Aug 11 '24 05:08 linvaux

i tried to solve it by fixing the echo commands the report generated but i get this issue which prevent the report from copying in th path `` 2024-08-12 12:32:21,056 INFO o.a.j.r.d.ReportGenerator: Exporting data using exporter:'html' of className:'org.apache.jmeter.report.dashboard.HtmlTemplateExporter' 2024-08-12 12:32:21,059 INFO o.a.j.r.d.HtmlTemplateExporter: Will generate dashboard in folder: /report/report-zuhauseplus_debug_test.jmx-2024-08-12T12:30:48Z 2024-08-12 12:32:21,287 INFO o.a.j.r.d.HtmlTemplateExporter: Report will be generated in: /report/report-zuhauseplus_debug_test.jmx-2024-08-12T12:30:48Z, creating folder structure 2024-08-12 12:32:21,289 INFO o.a.j.r.d.TemplateVisitor: Copying folder from '/opt/jmeter/apache-jmeter-5.6.3/bin/report-template' to '/report/report-zuhauseplus_debug_test.jmx-2024-08-12T12:30:48Z', got message: /report/report-zuhauseplus_debug_test.jmx-2024-08-12T12:30:48Z, found non empty folder with following content [/report/report-zuhauseplus_debug_test.jmx-2024-08-12T12:30:48Z/statistics.json], will be ignored 2024-08-12 12:32:21,777 INFO o.a.j.JMeter: Dashboard generated

mohamed-atef2022 avatar Aug 13 '24 10:08 mohamed-atef2022

@linvaux while i am using -f in jmeter command i think it doeesnt affect on the report creation or overwrite it

mohamed-atef2022 avatar Aug 13 '24 10:08 mohamed-atef2022

@linvaux while i am using -f in jmeter command i think it doeesnt affect on the report creation or overwrite it

-f while delete the old logfile and try to generate new report, see https://github.com/apache/jmeter/blob/3e9af5de35718ae31eabcd2e46cd5462760091ed/src/core/src/main/java/org/apache/jmeter/JMeter.java#L994

linvaux avatar Aug 14 '24 01:08 linvaux

i tried to add the flag itself jmeter ${param_user} ${param_properties} ${report_command_line} --logfile report-${jmx}-$(date +"%F_%H%M%S").jtl --nongui --forceDeleteResultFile --testfile ${jmx} -Dserver.rmi.ssl.disable=true --remoteexit --remotestart ${slave_list} >> jmeter-master.out 2>> jmeter-master.err i tried also to delete it explicity from the container but i get also this 2024-08-12 12:32:21,287 INFO o.a.j.r.d.HtmlTemplateExporter: Report will be generated in: /report/report-zuhauseplus_debug_test.jmx-2024-08-12T12:30:48Z, creating folder structure 2024-08-12 12:32:21,289 INFO o.a.j.r.d.TemplateVisitor: Copying folder from '/opt/jmeter/apache-jmeter-5.6.3/bin/report-template' to '/report/report-zuhauseplus_debug_test.jmx-2024-08-12T12:30:48Z', got message: /report/report-zuhauseplus_debug_test.jmx-2024-08-12T12:30:48Z, found non empty folder with following content [/report/report-zuhauseplus_debug_test.jmx-2024-08-12T12:30:48Z/statistics.json], will be ignored 2024-08-12 12:32:21,777 INFO o.a.j.JMeter: Dashboard generated

mohamed-atef2022 avatar Aug 14 '24 09:08 mohamed-atef2022

It looks like your report directory is not empty when jemter generating report, could you check the report dir is empty? by the way could you use markdown to replay when you show your code?

linvaux avatar Aug 14 '24 14:08 linvaux

i jus checked it th report directory has a data called report-template it is copied from /opt/jmeter/bin/report-template i think it is a files that copied to be filled in by the load test result but what i am confusing about why the flag of -f doesnt work to overwrite the data

mohamed-atef2022 avatar Aug 15 '24 11:08 mohamed-atef2022

@mohamed-atef2022 emm,you want to use jmeter cluster to run test and generate report?

linvaux avatar Aug 16 '24 05:08 linvaux

The parameter -f enables the overwriting of the jtl-file. It can not be used to overwrite existing reports. I think it would be best, if you would clean up your environment before starting a report generation/test run.

Or, if you want to keep old reports/jtl-files, use a different file name based on the start of the run instead of the creation time of your job.

FSchumacher avatar Oct 06 '24 15:10 FSchumacher