0

I have created JSF simple application and deployed tomcat7 and tomcat port number is 7070. The application details are:

1 main.jsp  
2 Login.java  
3 welcome.jsp

main.jsp page has one text field and one button GoWelcomePage
When we click this button action goes to login.welcomePage(). In this method put the sleep in 10000ms (10Secs) after that return the string value as welcome.
Then the page navigate into welcome.jsp page.

The process like
main.jsp-->login.goWelcomePage() {10secs or 10000ms sleep mode} -->welcome.jsp
Obviously we know this process take more than 10secs or 10000ms.

I test this simple application using Jmeter. It says the process time is less than 100ms. this is totally wrong.
I am not sure, i have given the tight parameters into the Jmeter.
main.jsp

<h:form id="mainFormId">
    <h:inputText value="#{login.userName}" />
    <h:commandButton value="Go Welcome Page" action="#{login.goWelcomePage}"/>
</h:form>

Login.java

package com.jsf.demo;
public class Login {
private String userName;
{
try {
        Thread.sleep(10000);
    } catch (InterruptedException e) {
    }
    return "welcome";
}

public String getUserName() {
    return userName;
}
public void setUserName(String userName) {
    this.userName = userName;
}}

welcome.jsp

<p> Welcome </p> <h:outputText value="#{login.userName}"/>

faces-config.xml

<managed-bean>
     <managed-bean-name>login</managed-bean-name>
     <managed-bean-class>com.jsf.demo.Login</managed-bean-class>
     <managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<navigation-rule>
     <from-view-id>faces/pages/main.jsp</from-view-id>
     <navigation-case>
        <from-outcome>welcome</from-outcome>
        <to-view-id>faces/pages/welcome.jsp</to-view-id>
     </navigation-case>
</navigation-rule>

Jmeter inputs
ThreadGroup: enter image description here HttpRequestDefaults: enter image description here HttpRequest: enter image description here Jmeter results
View Results in Table: Results in table Aggregate Report: enter image description here

My doubt is: did i gave the right inputs and getting right results in Jmeter tool?

Please help me. Thanks is advance.

user3782196
  • 113
  • 1
  • 6

1 Answers1

0

Your Inputs are fine, except in HttpRequest: Server Name, Port & Protocol should be empty. Since you have already specified these details in HTTP Request Defaults

The Jmeter Sample Time (the one you have highlighted) is the Response time, and what you are looking for is the Page load Time.

Check "Retrieve All Embedded resources from Html Files" in HTTP Sampler or HTTP Request Defaults.

Hope this will help.

Zubair M Hamdani
  • 1,693
  • 1
  • 13
  • 14
  • Thanks Jmeter PerfTest for your nice effort. I am looking the overall process time. means OverAllTime = from button click + goWelocmePage() + result page loading start. Is it possible to calculate the overalltime? – user3782196 Oct 20 '14 at 09:20
  • You can try with the above method. If this do not achieve the results you are looking for, then you need to write your own code in the BeanShell sampler for this. – Zubair M Hamdani Oct 20 '14 at 10:13
  • This post is telling response time and sample time are equal. http://stackoverflow.com/questions/18510846/jmeter-latency-vs-load-timesample-time. i am bit confused. – user3782196 Oct 28 '14 at 13:22
  • yes, but we are taking about response time & page load time – Zubair M Hamdani Oct 29 '14 at 04:39