With JMeter 3.0 Dashboard generation has become more interesting
and powerful.
a) How to use the following using 'Ant target' ?
jmeter -g /path/to/jtl/file -o /where/you/want/to/store/dashboard
b) How to Attach the Asset Validation Framework to the Dashboard.
This would help me generate Dashboard reports using Ant Tasks.
The easiest option would be to use ant's exec command.
<target name="generate-new-report">
<exec executable="${jmeter.home}/bin/jmeter.bat">
<arg value="-g"/>
<arg value="/path/to/jtl/file"/>
<arg value="-o"/>
<arg value="/where/you/want/to/store/dashboard"/>
</exec>
</target>
Related
In our project we are using a proprietary product which contains its own custom ant executable to build the deployment artifact.
So, we have two build files 'build-artifcat.xml' and 'build.xml'.
Here,
'build-artifcat.xml' - contains ant targets which can be executed with this products custom ant executable.
'build.xml' - contains ant targets which can be executed by Apache Ant.
We are using Bamboo CICD tool and this tool provides facility to execute only Apache Ant targets.
So, we are planning to use task to invoke ant targets from 'build-artifcat.xml' using this products custom ant executable.
I found below code while checking older projects but here I am not sure how can I specify the target to be executed from from 'build-artifcat.xml'.
Can you please help.
<target name="buildArtifact">
<echo>Running ant exec: ${run.custom.ant.exec}</echo>
<exec dir="${run.ant.exec.dir}" executable="${run.custom.ant.exec}" error="${basedir}/${error.log.file}">
<arg value="-f" />
<arg file="${basedir}/build-artifcat.xml" />
<arg value="-DimportDir=${import.location}" />
<arg value="-DartifactDir=${artifact.dir}" />
<arg value="-data" />
<arg value="${temp.workspace}" />
<arg value="-vmargs" />
<arg value="-Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./crashes/my-heap-dump.hprof -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:./crashes/gc.log" />
<arg value="-verbose" />
</exec>
</target>
Need to run this below command in the Ant exec tag.
windchill ext.cummins.securityLabel.CumminsLoadAgreement -d
%WT_HOME%/loadFiles/ext/cummins/Agreements/AgreementList/Agreement_Loader.xlsx -u wcadmin -p wcadmin
You can make use of Java Task in your ant script to perform this.
Use the below script
<java classname="ext.cummins.securityLabel.CumminsLoadAgreement" fork="true">
<arg value="${username}"/>
<arg value="${password}"/>
<arg value="-d"/>
<arg path="${Your_Custom_Directory}/${Custom_file}"/>
</java>
In a your ant xml file, define a ant target with the tag , the path for Windchill Home is accessible with the variable ${env.WT_HOME}
<project name="YourProjectName" default="YourTargetName" basedir=".">
<target name="YourTargetName">
<exec executable="windchill" dir="." failonerror="true">
<arg line="ext.cummins.securityLabel.CumminsLoadAgreement -d ${env.WT_HOME}/loadFiles/ext/cummins/Agreements/AgreementList/Agreement_Loader.xlsx -u wcadmin -p wcadmin" />
</exec>
</target>
</project>
From a windchill shell you can then run the target as "usual":
ant -f yourFile.xml YourTargetName
Tipp: if you name your ant file build.xml, you even do not need to specify it as parameter.
Is there a way to checkout files from RTC using Ant scripts?. I have a scenario where i need to checkout the files from RTC and build an app using Ant.
It should be possible to invoke scm command through <exec> ant task.
You can see some examples in "Using the SCM Command Line Interface in builds"
<property name="run" value="/path/to/run_and_filter.pl"/>
<property name="scm" value="/path/to/scm"/>
<target name="__scm-checkin">
<!-- Do the initial commit -->
<exec executable="${run}" failonerror="true" outputproperty="cs">
<arg value="${scm} --non-interactive -a n -u y checkin ${roots}"/>
<arg value=" \(([^)]+)\)"/>
</exec>
<!-- Deliver -->
<exec executable="${scm}" failonerror="true">
<arg value="--non-interactive"/>
<arg value="deliver"/>
<arg value="${cs}"/>
</exec>
</target>
Make sure to use scm though, not lscm which starts a damon and can cause the ant task to hang: see "Calling lscm.bat from a build script causes a hang".
RTC does not have a "check-out" operation, which is implicit. It only has a check-in operation. If you want to get code from a repository workspace you can load it using scm command, as described before, or creating a java standalone using Plain API.
As per project requirement i am using JMeter as Loadtesting tool. JMeterPlugin available on http://jmeter-plugins.org really leverages your overall load testing results. I am using perfmon plugin and capture CPU,Memory, Disk IO and Network IO (this internally uses SIGAR framwrok). That works fine in UI Mode, but while i launched Jmeter using ANT in non gui mode, it's able to generate graphs specific to Jmeter (Response time,TPS, etc) but not able to generate System matrices which i included in test plan. did any one has tried this Plugin in Non GUI mode?
Please find below snippet of build.xml
<target name="create-graphs" depends="create-reports">
<ac:for param="reportType" list="AggregateReport,HitsPerSecond,ResponseTimesPercentiles,ThroughputOverTime,ThroughputVsThreads,TimesVsThreads,ResponseTimesOverTime,ThreadsStateOverTime,TransactionsPerSecond">
<sequential>
<java jar="${jmeter.home}/lib/ext/CMDRunner.jar" fork="true">
<arg value="--tool"/>
<arg value="Reporter"/>
<arg value="--generate-png"/>
<arg value="${result.path}/#{reportType}.png"/>
<arg value="--input-jtl"/>
<arg value="${result.path}/JMeterResults.xml"/>
<arg value="--plugin-type"/>
<arg value="#{reportType}"/>
<arg value="--width"/>
<arg value="800"/>
<arg value="--height"/>
<arg value="600"/>
</java>
</sequential>
</ac:for>
</target>
Thanks,
Priyank Shah
As far as I know, Servers Performance Monitoring listener saves results in its own separate result file, not the common result file. So you should use this separate file for reporting.
I have an exiting ant build that is called via ant -lib lib -f test_build.xml
I wanted to add one more <target> section to be run after the existing one finishes. I did some research and found ant manual for exec and even a question here on SO. After some reading I added new target to this existing build but it didn't work.
I tried to create new build file only with my target. It doesn't work either. Although the ant run finishes with message BUILD SUCCESSFUL
Total time: 0 seconds
If I run my ruby script from a command line it works. I tried to create bat file that would call my ruby script with the same result. If I call the bat file from dos window it works.
My ant run build file looks like
<project name="RunRubyExample">
<target name="calling ruby " >
<exec executable="ruby.exe">
<arg value="C:\EduTester\others\afterant.rb 1 2 tri four"/>
</exec>
</target>
<target name="calling batach">
<exec executable="cmd">
<arg value="/c"/>
<arg value="C:\EduTester\others\rubruby.bat 1 2 tri four"/>
</exec>
</target>
</project>
Apache Ant(TM) version 1.8.2 compiled on December 20 2010
on Windows XP
It looks like you're passing a single arg value with embedded spaces
<arg value="C:\EduTester\others\afterant.rb 1 2 tri four"/>
Is that right? Or should it be either an arg line:
<arg line="C:\EduTester\others\afterant.rb 1 2 tri four"/>
or multiple arg values:
<arg value="C:\EduTester\others\afterant.rb"/>
<arg value="1"/>
<arg value="2"/>
<arg value="tri"/>
<arg value="four"/>
There needs to be specified target that needs to be run
either by <project name="RunRubyExample" default="callingruby">
or when calling the ant build file. Where we pass the target name we want to be run as an argument. ant -lib lib callingruby
Writing a Simple Buildfile
Thank you #Steve