为了应对不同的运行需求(主要是不同的线程数),以及可能的变化(host ip),在nongui运行时我对ant build.xml进行了一些修改
  1. log目录备份与运行前清除

 

<tstamp>
<format property="time.stamp" pattern="HHmmss_yyyyMMdd"/>
</tstamp>
<property name="bak.dir" value="c:/apache-jmeter-2.10/bin/testresult/${time.stamp}" />
<property name="result.dir" value="c:/apache-jmeter-2.10/bin/testresult" />
<property name="jmeter.extra" value="c:/apache-jmeter-2.10/extras" />
<target name="clean" depends="">
<delete verbose="true">
<fileset dir="${result.dir}">
<include name="*.csv" />
<include name="*.jtl" />
</fileset>
<fileset dir="${jmeter.extra}">
<include name="*.jtl" />
<include name="*.log" />
</fileset>
</delete>
</target>
<target name="bak">
<copy todir="${bak.dir}" verbose="true">
<fileset dir="${result.dir}">
<include name="*.csv" />
<include name="*.jtl" />
</fileset>
<fileset dir="${jmeter.extra}">
<include name="*.jtl" />
<include name="*.log" />
</fileset>
</copy>
</target>