You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by sandy320 <sa...@sohu.com> on 2010/04/12 09:44:25 UTC

How to get the analyze result of custom Java Request?

A custom Java Request to test Server.

I can get the 2 value times of Client==>Sever and Server==>Client in custom
Java Request class

The question is how to set these 2 value to JMeter Summary Report?

I want to analyze these 2 value, such as min,max,avg...


Thanks.
-- 
View this message in context: http://old.nabble.com/How-to-get-the-analyze-result-of-custom-Java-Request--tp28214766p28214766.html
Sent from the JMeter - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: How to get the analyze result of custom Java Request?

Posted by Deepak Shetty <sh...@gmail.com>.
You can add them as variablkes
JMeterContextService.
getContext().getVariables().put("clientToServer",String.valueOf(clientToServer));

JMeterContextService.
getContext().getVariables().put("ServerToClient",String.valueOf(ServerToClient));



and use sample_variables to be clientToServer,ServerToClient. This will then
get saved along with the sample and you can post process the result

OR

If you want it to be part of response you have to call methods on
SampleResult . If you just want some text returned , you can just have it as
setResponseData.  (though this will be difficult to parse)

OR
You could also create Sub Result and add them with respective times -- see
method addSubResult --
http://jakarta.apache.org/jmeter/api/org/apache/jmeter/samplers/SampleResult.html


On Tue, Apr 13, 2010 at 7:29 PM, sandy320 <sa...@sohu.com> wrote:

>
> Thanks.
>
> Could you please explain it more detail?
>
> In Java Request Class
>
> public class TestP2P extends AbstractJavaSamplerClient{
>
>    public SampleResult runTest(JavaSamplerContext context) {
>        Long clientToServer=...;   //the time from client to server
>        Long ServerToClient=...;   //the time from server to client
>
>       //I want to analyze these 2 values in JMeter Report
>       // Which method of SampleResult should be invoke to set them to
> result?
>     }
> }
>
>
>
>
>
> sebb-2-2 wrote:
> >
> > On 12/04/2010, sandy320 <sa...@sohu.com> wrote:
> >>
> >>  A custom Java Request to test Server.
> >>
> >>  I can get the 2 value times of Client==>Sever and Server==>Client in
> >> custom
> >>  Java Request class
> >>
> >>  The question is how to set these 2 value to JMeter Summary Report?
> >>
> >>  I want to analyze these 2 value, such as min,max,avg...
> >>
> >
> > Samplers can set the latency and elapsed times in sample results.
> >
> > However only elapsed time is currently processed by the Summary report.
> >
> > You can add any variables to the saved data:
> >
> >
> http://jakarta.apache.org/jmeter/usermanual/listeners.html#sample_variables
> >
> > However, you will have to process the data yourself.
> >
> >>  Thanks.
> >>
> >> --
> >>  View this message in context:
> >>
> http://old.nabble.com/How-to-get-the-analyze-result-of-custom-Java-Request--tp28214766p28214766.html
> >>  Sent from the JMeter - User mailing list archive at Nabble.com.
> >>
> >>
> >>  ---------------------------------------------------------------------
> >>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> >>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/How-to-get-the-analyze-result-of-custom-Java-Request--tp28214766p28237745.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: How to get the analyze result of custom Java Request?

Posted by sebb <se...@gmail.com>.
On 14/04/2010, sandy320 <sa...@sohu.com> wrote:
>
>  Thanks.
>
>  Could you please explain it more detail?
>
>  In Java Request Class
>
>  public class TestP2P extends AbstractJavaSamplerClient{
>
>     public SampleResult runTest(JavaSamplerContext context) {
>         Long clientToServer=...;   //the time from client to server
>         Long ServerToClient=...;   //the time from server to client
>
>        //I want to analyze these 2 values in JMeter Report
>        // Which method of SampleResult should be invoke to set them to
>  result?

Have a look at the Javadoc:

http://jakarta.apache.org/jmeter/api/org/apache/jmeter/samplers/SampleResult.html

>     }
>  }
>
>
>
>
>
>  sebb-2-2 wrote:
>  >
>  > On 12/04/2010, sandy320 <sa...@sohu.com> wrote:
>  >>
>  >>  A custom Java Request to test Server.
>  >>
>  >>  I can get the 2 value times of Client==>Sever and Server==>Client in
>  >> custom
>  >>  Java Request class
>  >>
>  >>  The question is how to set these 2 value to JMeter Summary Report?
>  >>
>  >>  I want to analyze these 2 value, such as min,max,avg...
>  >>
>  >
>  > Samplers can set the latency and elapsed times in sample results.
>  >
>  > However only elapsed time is currently processed by the Summary report.
>  >
>  > You can add any variables to the saved data:
>  >
>  > http://jakarta.apache.org/jmeter/usermanual/listeners.html#sample_variables
>  >
>  > However, you will have to process the data yourself.
>  >
>  >>  Thanks.
>  >>
>  >> --
>  >>  View this message in context:
>  >> http://old.nabble.com/How-to-get-the-analyze-result-of-custom-Java-Request--tp28214766p28214766.html
>  >>  Sent from the JMeter - User mailing list archive at Nabble.com.
>  >>
>  >>
>  >>  ---------------------------------------------------------------------
>  >>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  >>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  >>
>  >>
>  >
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>  >
>  >
>  >
>
>
> --
>  View this message in context: http://old.nabble.com/How-to-get-the-analyze-result-of-custom-Java-Request--tp28214766p28237745.html
>
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: How to get the analyze result of custom Java Request?

Posted by sandy320 <sa...@sohu.com>.
Thanks.

Could you please explain it more detail?

In Java Request Class

public class TestP2P extends AbstractJavaSamplerClient{

    public SampleResult runTest(JavaSamplerContext context) {
        Long clientToServer=...;   //the time from client to server
        Long ServerToClient=...;   //the time from server to client

       //I want to analyze these 2 values in JMeter Report
       // Which method of SampleResult should be invoke to set them to
result?
    }
}





sebb-2-2 wrote:
> 
> On 12/04/2010, sandy320 <sa...@sohu.com> wrote:
>>
>>  A custom Java Request to test Server.
>>
>>  I can get the 2 value times of Client==>Sever and Server==>Client in
>> custom
>>  Java Request class
>>
>>  The question is how to set these 2 value to JMeter Summary Report?
>>
>>  I want to analyze these 2 value, such as min,max,avg...
>>
> 
> Samplers can set the latency and elapsed times in sample results.
> 
> However only elapsed time is currently processed by the Summary report.
> 
> You can add any variables to the saved data:
> 
> http://jakarta.apache.org/jmeter/usermanual/listeners.html#sample_variables
> 
> However, you will have to process the data yourself.
> 
>>  Thanks.
>>
>> --
>>  View this message in context:
>> http://old.nabble.com/How-to-get-the-analyze-result-of-custom-Java-Request--tp28214766p28214766.html
>>  Sent from the JMeter - User mailing list archive at Nabble.com.
>>
>>
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/How-to-get-the-analyze-result-of-custom-Java-Request--tp28214766p28237745.html
Sent from the JMeter - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: How to get the analyze result of custom Java Request?

Posted by sebb <se...@gmail.com>.
On 12/04/2010, sandy320 <sa...@sohu.com> wrote:
>
>  A custom Java Request to test Server.
>
>  I can get the 2 value times of Client==>Sever and Server==>Client in custom
>  Java Request class
>
>  The question is how to set these 2 value to JMeter Summary Report?
>
>  I want to analyze these 2 value, such as min,max,avg...
>

Samplers can set the latency and elapsed times in sample results.

However only elapsed time is currently processed by the Summary report.

You can add any variables to the saved data:

http://jakarta.apache.org/jmeter/usermanual/listeners.html#sample_variables

However, you will have to process the data yourself.

>  Thanks.
>
> --
>  View this message in context: http://old.nabble.com/How-to-get-the-analyze-result-of-custom-Java-Request--tp28214766p28214766.html
>  Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org