You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by igora88 <my...@gmail.com> on 2014/07/24 18:24:32 UTC

How to generate and save to file SummaryReport or any other JMeter Report

Hello All.
I have created simple JMeter Test and i don't know how to generate and save
some kind of JMeter report(Summary Report, View results in Table e.t.c) to
some file.

My code looks like this:
package com.genesyslab.gks.ats.scenario.jmeter;

import com.genesyslab.gks.ats.scenario.BaseScenario;
import org.apache.jmeter.control.LoopController;
import org.apache.jmeter.engine.StandardJMeterEngine;
import org.apache.jmeter.protocol.http.sampler.HTTPSampler;
import org.apache.jmeter.testelement.TestElement;
import org.apache.jmeter.testelement.TestPlan;
import org.apache.jmeter.threads.SetupThreadGroup;
import org.apache.jmeter.util.JMeterUtils;
import org.apache.jorphan.collections.HashTree;

/**
 * Created by IMykytyn on 7/24/2014.
 */
public class JMeterTest extends BaseScenario{

    @Override
    protected void scenario() throws Exception {
        // Engine
        StandardJMeterEngine jm = new StandardJMeterEngine();
        // jmeter.properties
        JMeterUtils.loadJMeterProperties("D:/Java
Tools/JMeter/apache-jmeter-2.11/apache-jmeter-2.11/bin/jmeter.properties");

        HashTree hashTree = new HashTree();

        // HTTP Sampler
        HTTPSampler httpSampler = new HTTPSampler();
        httpSampler.setDomain("192.168.67.98");
        httpSampler.setPort(8080);
        httpSampler.setPath("/gks-server");
        httpSampler.setMethod("GET");

        // Loop Controller
        TestElement loopCtrl = new LoopController();
        ((LoopController)loopCtrl).setLoops(1);
        ((LoopController)loopCtrl).addTestElement(httpSampler);
        ((LoopController)loopCtrl).setFirst(true);

        // Thread Group
        SetupThreadGroup threadGroup = new SetupThreadGroup();
        threadGroup.setNumThreads(1);
        threadGroup.setRampUp(1);
        threadGroup.setSamplerController((LoopController)loopCtrl);

        TestPlan testPlan = new TestPlan("MY TEST PLAN");
        testPlan.setTestPlanClasspath("D:/JMeterTestPlan/test.jmx");

        hashTree.add("testPlan", testPlan);
        hashTree.add("loopCtrl", loopCtrl);
        hashTree.add("threadGroup", threadGroup);
        hashTree.add("httpSampler", httpSampler);

        jm.configure(hashTree);

        //Run TEST
        jm.run();
    }
}

Please Help Me!
With Best Regards!



--
View this message in context: http://jmeter.512774.n5.nabble.com/How-to-generate-and-save-to-file-SummaryReport-or-any-other-JMeter-Report-tp5720668.html
Sent from the JMeter - Dev mailing list archive at Nabble.com.

Re: How to generate and save to file SummaryReport or any other JMeter Report

Posted by Dzmitry_Kashlach <dz...@gmail.com>.
I suppose, that you can look into Simple Data Writer and use implementation
from that listener, because Simple Data Writer does exactly the same what
you need to do.



--
View this message in context: http://jmeter.512774.n5.nabble.com/How-to-generate-and-save-to-file-SummaryReport-or-any-other-JMeter-Report-tp5720668p5720707.html
Sent from the JMeter - Dev mailing list archive at Nabble.com.

Re: How to generate and save to file SummaryReport or any other JMeter Report

Posted by Andrey Pokhilko <ap...@ya.ru>.
Sorry, guys, I'm crazy maintaining several projects.

Andrey Pokhilko

On 10/31/2015 09:57 AM, Andrey Pokhilko wrote:
> Hi,
>
> Summary stats generating is disabled by Taurus intentionally. This is
> done because Taurus itself replaces this summary functionality. Also,
> generating summary results uses some resources which better be spared
> for load generating.
>
> Andrey Pokhilko
>
> On 10/30/2015 09:30 AM, Harikrishna Kallae wrote:
>> MukeshPal wrote
>>> I am getting summary as:
>>>
>>> summary =      0 in     0s = ******/s Avg:     0 Min:     0 Max:     0
>>> Err:     0 (0.00%)
>> I am facing the same issue, were you able to resolve this?
>>
>> Thanks,
>> Hari
>>
>>
>>
>> --
>> View this message in context: http://jmeter.512774.n5.nabble.com/How-to-generate-and-save-to-file-SummaryReport-or-any-other-JMeter-Report-tp5720668p5723384.html
>> Sent from the JMeter - Dev mailing list archive at Nabble.com.


Re: How to generate and save to file SummaryReport or any other JMeter Report

Posted by Andrey Pokhilko <ap...@ya.ru>.
Hi,

Summary stats generating is disabled by Taurus intentionally. This is
done because Taurus itself replaces this summary functionality. Also,
generating summary results uses some resources which better be spared
for load generating.

Andrey Pokhilko

On 10/30/2015 09:30 AM, Harikrishna Kallae wrote:
> MukeshPal wrote
>> I am getting summary as:
>>
>> summary =      0 in     0s = ******/s Avg:     0 Min:     0 Max:     0
>> Err:     0 (0.00%)
> I am facing the same issue, were you able to resolve this?
>
> Thanks,
> Hari
>
>
>
> --
> View this message in context: http://jmeter.512774.n5.nabble.com/How-to-generate-and-save-to-file-SummaryReport-or-any-other-JMeter-Report-tp5720668p5723384.html
> Sent from the JMeter - Dev mailing list archive at Nabble.com.


Re: How to generate and save to file SummaryReport or any other JMeter Report

Posted by Harikrishna Kallae <ha...@gmail.com>.
MukeshPal wrote
> I am getting summary as:
> 
> summary =      0 in     0s = ******/s Avg:     0 Min:     0 Max:     0
> Err:     0 (0.00%)

I am facing the same issue, were you able to resolve this?

Thanks,
Hari



--
View this message in context: http://jmeter.512774.n5.nabble.com/How-to-generate-and-save-to-file-SummaryReport-or-any-other-JMeter-Report-tp5720668p5723384.html
Sent from the JMeter - Dev mailing list archive at Nabble.com.

Re: How to generate and save to file SummaryReport or any other JMeter Report

Posted by Dzmitry_Kashlach <dz...@gmail.com>.
What do you want to change? Not sure, that I've understood you.



--
View this message in context: http://jmeter.512774.n5.nabble.com/How-to-generate-and-save-to-file-SummaryReport-or-any-other-JMeter-Report-tp5720668p5720727.html
Sent from the JMeter - Dev mailing list archive at Nabble.com.

Re: How to generate and save to file SummaryReport or any other JMeter Report

Posted by Dzmitry_Kashlach <dz...@gmail.com>.
1. Try to create relative path
<folder-where-you-start-test>/bin/saveservice.properties
2. If this does not help, show stacktrace.



--
View this message in context: http://jmeter.512774.n5.nabble.com/How-to-generate-and-save-to-file-SummaryReport-or-any-other-JMeter-Report-tp5720668p5720725.html
Sent from the JMeter - Dev mailing list archive at Nabble.com.

Re: How to generate and save to file SummaryReport or any other JMeter Report

Posted by Dzmitry_Kashlach <dz...@gmail.com>.
Look here: this is ResultCollector which is writing samples to file.
https://github.com/apache/jmeter/blob/trunk/src/core/org/apache/jmeter/reporters/ResultCollector.java



--
View this message in context: http://jmeter.512774.n5.nabble.com/How-to-generate-and-save-to-file-SummaryReport-or-any-other-JMeter-Report-tp5720668p5720709.html
Sent from the JMeter - Dev mailing list archive at Nabble.com.