Performance report graphs were blank after running a test

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Performance report graphs were blank after running a test

viji1188
This post was updated on .
Hi,

I use nGrinder 3.1.1 and JDK version 1.7.0_10. I ran a test which checks the status code for two URLs. Following is the sample script:

from net.grinder.script.Grinder import grinder
from net.grinder.script import Test
from net.grinder.plugin.http import HTTPRequest
from Jumpstart import Jumpstart
from Google import Google

class TestRunner:
        def __call__(self):
                Google()
                Jumpstart()

Google.py:

from net.grinder.script.Grinder import grinder
from net.grinder.script import Test
from java.lang import System

def Google():
                grinder.statistics.delayReports=True
                request1 = Test(2, "Google").wrap(HTTPRequest())
                currentTime = System.currentTimeMillis()
                result = request1.GET("http://www.google.com")
                timeTaken = System.currentTimeMillis()
                googlet = timeTaken - currentTime
                grinder.logger.info(" vij google time " + str(googlet))
                if result.getStatusCode() == 200 :
                        grinder.statistics.forLastTest.success = 0
                else :
                        grinder.statistics.forLastTest.success = 1

Jumpstart.py:

from net.grinder.script.Grinder import grinder
from net.grinder.script import Test
from net.grinder.plugin.http import HTTPRequest
from java.lang import System

def Jumpstart():
                grinder.statistics.delayReports=True
                request1 = Test(1, "Jumpstart").wrap(HTTPRequest())
                currentTime = System.currentTimeMillis()
                result = request1.GET("http://www.jumpstart.com")
                timeTaken = System.currentTimeMillis()
                jst = timeTaken - currentTime
                grinder.logger.info(" vij jumpstart time " + str(jst))
                if result.getStatusCode() == 200 :
                        grinder.statistics.forLastTest.success = 1
                else :
                        grinder.statistics.forLastTest.success = 0

I ran it for 5 minutes with 1 process and 3 VUsers. No graphs images were created on viewing the detailed report (after finishing the test).
The following is the log file.
log.txt

TPS, MEAN TEST TIME, MEAN TIME TO FIRST BYTE and ERRORS GRAPHS were empty. What could have gone wrong?

Thanks
Vij
Reply | Threaded
Open this post in threaded view
|

Re: Performance report graphs were blank after running a test

junoyoon
Administrator
You should locate the Test instance creation out of the method which is called in thread like.

request = HTTPRequest()
Test(1, "Jumpstart").record(request)
grinder.statistics.delayReports=True

def Jumpstart():
                currentTime = System.currentTimeMillis()
                result = request1.GET("http://www.jumpstart.com")
                timeTaken = System.currentTimeMillis()
                jst = timeTaken - currentTime
                grinder.logger.info(" vij jumpstart time " + str(jst))
                if result.getStatusCode() == 200 :
                        grinder.statistics.forLastTest.success = 1
                else :
                        grinder.statistics.forLastTest.success = 0
Reply | Threaded
Open this post in threaded view
|

Re: Performance report graphs were blank after running a test

viji1188
Hi Junoyoon,

I tried the same but i get a SCRIPT_ERROR when i type
"grinder.statistics.delayReports=True"
outside the method.
When I place just the above command inside the method and run the test, the graphs appear empty.

Thanks,
Vij
Reply | Threaded
Open this post in threaded view
|

Re: Performance report graphs were blank after running a test

junoyoon
Administrator

Usually this method should be located in the main python class's __init__ method.. 

Anyway.. good to hear that you now see the graph.

 

-----Original Message-----
From: "viji1188 [via ngrinder]"<[hidden email]>
To: "junoyoon"<[hidden email]>;
Cc:
Sent: 2013-02-26 (화) 15:39:34
Subject: Re: Performance report graphs were blank after running a test

Hi Junoyoon,

I tried the same but i get a SCRIPT_ERROR when i type
"grinder.statistics.delayReports=True"
outside the method.
When I place just the above command inside the method and run the test, the graphs appear empty.

Thanks,
Vij


If you reply to this email, your message will be added to the discussion below:
http://ngrinder.642.n7.nabble.com/Performance-report-graphs-were-blank-after-running-a-test-tp366p368.html
To start a new topic under ngrinder-user-en, email [hidden email]
To unsubscribe from ngrinder-user-en, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: Performance report graphs were blank after running a test

viji1188
This post was updated on .
No the graphs still do not appear. If i try to place the commands to the main class's _init_ method, can we have different test instances for the "google" and "jumpstart" methods?
Reply | Threaded
Open this post in threaded view
|

Re: Performance report graphs were blank after running a test

junoyoon
Administrator
It works in my env. I integrated both script into one for testing..


from net.grinder.script.Grinder import grinder
from net.grinder.script import Test
from net.grinder.plugin.http import HTTPRequest
from java.lang import System

class TestRunner:
        def __init__(self):
                grinder.statistics.delayReports=True        
        def __call__(self):
                Google()
                Jumpstart()

request1 = Test(2, "Google").wrap(HTTPRequest())
def Google():
                currentTime = System.currentTimeMillis()
                result = request1.GET("http://www.google.com")
                timeTaken = System.currentTimeMillis()
                googlet = timeTaken - currentTime
                grinder.logger.info(" vij google time " + str(googlet))
                if result.getStatusCode() == 200 :
                        grinder.statistics.forLastTest.success = 0
                else :
                        grinder.statistics.forLastTest.success = 1

request2 = Test(1, "Jumpstart").wrap(HTTPRequest())
def Jumpstart():

                currentTime = System.currentTimeMillis()
                result = request2.GET("http://www.jumpstart.com")
                timeTaken = System.currentTimeMillis()
                jst = timeTaken - currentTime
                grinder.logger.info(" vij jumpstart time " + str(jst))
                if result.getStatusCode() == 200 :
                        grinder.statistics.forLastTest.success = 1
                else :
                        grinder.statistics.forLastTest.success = 0
Reply | Threaded
Open this post in threaded view
|

Re: Performance report graphs were blank after running a test

viji1188
I tried the code you mentioned but the graphs still do not appear after running the test for 3 minutes (in "Report in Detail" i.e. "Performance report")
Reply | Threaded
Open this post in threaded view
|

Re: Performance report graphs were blank after running a test

junoyoon
Administrator

I've run this script in the demo machine, it works..



There might be two suspicious problems.

1. Anti-Virus scan in IDC network. I had same problem before. some anti-virus scan in the IDC filter out nGrinder traffic b/w agent and controller.
   If the agent and controller are running on the same machine, this is not applied.

2. I highly recommend you to install ngrinder into linux or windows 7.

    We do not test Windows XP you have.. Please participate in our beta testing program if you think windows XP should be tested before release.

 

Regards.

 

Reply | Threaded
Open this post in threaded view
|

Re: Performance report graphs were blank after running a test

viji1188
Thanks JunHo, I have posted a new question based on this.