????2. ???ζ???jmeter run

 


<target name="run" depends="clean">
<mkdir dir="${bak.dir}" />
<property name="run.log" value="${bak.dir}/${th}_${loop}.log"/>
<echo message="${run.log}"/>
<record name="${run.log}"/>
<echo>funcMode = ${funcMode}</echo>
<delete file="${testpath}/${test}.html" />
<echo message="server: ${host}:${port}"/>
<echo message="threads = ${th}"/>
<echo message="loops   = ${loop}"/>
<jmeter jmeterhome="${jmeter.home}" testplan="${testpath}/${test}.jmx" resultlog="${testpath}/${test}.jtl"
jmeterlogfile="${testpath}/${test}.log" >
<jvmarg value="-L jmeter=DEBUG"/>
<property name="jmeter.save.saveservice.output_format" value="xml" />
<property name="jmeter.save.saveservice.assertion_results" value="all" />
<property name="jmeter.save.saveservice.bytes" value="true" />
<property name="file_format.testlog" value="${format}" />
<property name="jmeter.save.saveservice.response_data.on_error" value="${funcMode}" />
<property name="request.threads" value="${th}" />
<property name="request.threads.loop" value="${loop}" />
<property name="test.host" value="${host}" />
<property name="test.port" value="${port}" />
<property name="loadtest.rampUp" value="${ramp}" />
<property name="request.config" value="${config}" />
</jmeter>
<antcall target="bak" />
</target>

 

??????????????????jmx??????????Щ???????
????3. ???ж??jmx???????У?????ant?? antcontrib????????

 

<taskdef resource="net/sf/antcontrib/antlib.xml" />
<property file="./api_build.properties" />
<target name="apirun" depends="clean">
<mkdir dir="${bak.dir}" />
<property name="run.log" value="${bak.dir}/${th}_${loop}.log" />
<echo message="${run.log}" />
<record name="${run.log}" />
<echo>funcMode = ${funcMode}</echo>
<delete file="${testpath}/${test}.html" />
<echo message="server: ${host}:${port}" />
<echo message="threads = ${th}" />
<echo message="loops   = ${loop}" />
<for list="${perf.apis}" param="api">
<sequential>
<echo message="Now start the testing of API: @{api}" />
<jmeter jmeterhome="${jmeter.home}" testplan="${testpath}/${test}.jmx" resultlog="${testpath}/${test}.jtl" jmeterlogfile="${testpath}/${test}.log">
<jmeterarg value="-L jmeter=DEBUG" />
<property name="jmeter.save.saveservice.output_format" value="xml" />
<property name="jmeter.save.saveservice.assertion_results" value="all" />
<property name="jmeter.save.saveservice.bytes" value="true" />
<property name="file_format.testlog" value="${format}" />
<property name="jmeter.save.saveservice.response_data.on_error" value="${funcMode}" />
<property name="request.threads" value="${th}" />
<property name="request.threads.loop" value="${loop}" />
<property name="test.host" value="${host}" />
<property name="test.port" value="${port}" />
<property name="loadtest.rampUp" value="${ramp}" />
<property name="request.config" value="${config}" />
<property name="api" value="@{api}" />
</jmeter>
</sequential>
</for>
<antcall target="bak" />
</target>

??????api_build.properties??д?? perf.apis=xxx??xxx??xxx??xxx??????????????