Tan | 20 Feb 16:27 2013
Picon

grinder.sleep()

In the logs does the mean time count the grinder.sleep() amounts as well?  

ie If I have a script that takes 5ms to run and in the middle I put in a
sleep for 20ms will the total time be 5ms or 25ms.

Thanks

Tan

--
View this message in context: http://grinder.996249.n3.nabble.com/grinder-sleep-tp8316.html
Sent from the Grinder - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
Ravi Joshi | 18 Feb 20:53 2013
Picon

Questions about The Grinder 3.11 REST services

Hi,

Currently I am using The Grinder 3.10. I have two questions about The Grinder 3.11 REST services-

(1) Can I start agents (don't be confused with the workers please) from these services? As POST /agents/start-workers sends a start signal to the agents to start worker processes, so it can't start agent. Agent must be up and waiting for signals.

(2) After finishing the execution of agents, can i get any invocation message or any information automatically? Or do i need to query periodically the GET /agents/status service?

Thank you.
Ravi
------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use
anil_jacob | 16 Feb 02:01 2013
Picon
Picon

Doc correction - Console Port

I think the default ConsolePort is 6373. However documentation for the properties or grinder properties file mentions the default as being 6372.

Need to correct it else can be confusing to users.

Anil
------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use
Bradley, Lukas (ETW | 15 Feb 19:37 2013

Grinder - TCPProxy - Not Logging 302s?

 

I’m using TCPProxy as a full-log of sorts, so I can debug ALL flow of traffic between my workers and the server.  However, I seem to be missing 302 redirects, the subsequent GET request, and its content.

 

While my grinder workers are set to follow redirects, the proxy is a completely different process.  As a proxy, it would seem to me it would log EVERYTHING flowing through. 

 

I’m using both the default ECHO filter for input and output.

 

Am I missing something?  Is this intended behavior?

 

Any and all help appreciated.

 

Lukas

 

------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use
Bill Smith | 14 Feb 23:46 2013
Picon

extracting inputs from response body

In the webapp I'm testing, there used to be pages with hidden inputs that were posted in subsequent HTTP requests.  Of course, Grinder deals with that; the valueFromHiddenInput method on the HTTPUtilities interface will return the value of a hidden input.

In the latest version of the webapp, some of those inputs are now values in a JSON blob embedded in a <script> element.  A Javascript callback (or something) fills those values into the page once the page is loaded.  

I need some of those values to construct subsequent HTTP requests, so I am trying to figure out how I can extract them from an HTTP response.  Is there a hook in Grinder that I can use to extract additional information from the payload of an HTTP response?
(I'm currently using Grinder 3.8 because that's what was current when I last touched this code last spring.  However, I can use a newer version if it helps to do so.)

Thanks,
Bill Smith
Austin, TX
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use
Sean Tiley | 14 Feb 15:17 2013
Picon

TCPProxy - Downloading content (PDF)

Hello,
I am using Grinder 3.11 and have used the TCPProxy to record and interaction with my web site that downloads a PDF form.
 
During the recording a file is created (http-data-0.dat)..   There is also a the following in the recorded perl file
 
request1401 = createRequest(Test(1401, 'POST cdms.aspx'), url0)
request1401.setDataFromFile('http-data-0.dat')
 
Can anyone shed some light on the purpose of this file. 
 
If I remove the "request1401.setDataFromFile('http-data-0.dat')" from the script, the response from the download link is a form with 2 fields:
File Name, Base 64 Content and a Convert button.
 
Any insight is greatly appreciated.
 
 
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use
Tan | 13 Feb 19:09 2013
Picon

Re: Failed to determine proxy destination.

I did find out my problem with this. When setting my proxy to localhost in
firefox I did not see that localhost was in the 'no proxy for' box.  After
removing localhost from that text area the error no longer showed up.

--
View this message in context: http://grinder.996249.n3.nabble.com/Failed-to-determine-proxy-destination-tp6000p8297.html
Sent from the Grinder - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
Tan | 13 Feb 18:34 2013
Picon

Spike Test - Parallel?

Hi,

I am wanting to do a spike test (100 users doing a form submission at the
same time with unique values).  

If I were to use 100 threads, 100 scripts (script1, script2,...) would I do
the following in properties file?

test.script.percent.script1=1
test.script.percent.script2=1
.
.
.
test.script.percent.script100=1

grinder.threads=100

Or is there a more efficient/better way to do this?

Thanks

Tan

--
View this message in context: http://grinder.996249.n3.nabble.com/Spike-Test-Parallel-tp8294.html
Sent from the Grinder - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
Philip Aston | 9 Feb 10:42 2013
Picon

Re: Inspect HTML response

Jython is failing to write a UTF-16 string to a file. We can fix the
file encoding (print>> file,response.text.encode("UTF-8")), but as Gary
has pointed out, the underlying problem is that you're not first
decoding the gzipped body.

response.getText() returns a UTF string created by interpreting the
bytes received from the wire using the appropriate Content-Type response
header, falling back to ISO-8859-1 if there is no such header.
Interestingly \ufffd is "REPLACEMENT CHARACTER" - used to replace an
incoming character whose value is unknown or unrepresentable in Unicode.
This is because the content has not been gunzipped.

You can ask the grinder to handle the content type and gzip the body.
The simple thing to do is to uncompress everything. This can be done by
adding the following to the top of your script

    connectionDefaults.useContentEncoding = True

Gary's right to say this might unnecessarily burn a lot of CPU if you're
not interested in every response (which is why The Grinder doesn't
gunzip by default), so extending the 1 in 100 approach, you could say
(untested):

    def __call__(self):
       logResponse = grinder.runNumber % 100 == 0
       # Do this for all of the URLs

HTTPPluginControl.getThreadConnection("http://google.ca").useContentEncoding
= logResponse

       self.page1()
       # ...

def saveHtmlToFile (prefix, response, testId):
    if response.getHeader("Content-Encoding").find("gzip") >= 0:
       # Not decoded
       return

    inputStream = response.getInputStream()
    filename = "%s-%d-page-%d.html" %
(grinder.processName,testId,grinder.runNumber)
    file = open(filename,"w")
    print>> file,response.text
    file.close()
    return filename

- Phil

On 08/02/13 19:38, Sean Tiley wrote:
> Thanks Phil, When I make that adjustment I am getting the following
> error when writing the file..
>  
>
> 2013-02-08 14:30:57,409 ERROR Tiley-HP-0 thread-0 [ run-0 ]: aborted
> run - Jython exception, <type 'exceptions.UnicodeEncodeError'>:
> 'ascii' codec can't encode character u'\ufffd' in position 1: ordinal
> not in range(128) [calling TestRunner]
> net.grinder.scriptengine.jython.JythonScriptExecutionException: <type
> 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character
> u'\ufffd' in position 1: ordinal not in range(128)
>  print>> file,response.text
>  File ".\sean3.py", line 176, in saveHtmlToFile
>  saveHtmlToFile("4XX",result,401)
>  
> This seems really hard.  I understand that there are a bunch of sub
> requests going on and that there are images etc buit if I only log the
> request that gets text i get the same issue, clearly there is
> somethiong I am missing the boat on.
>  
> Thanks
> Anyways.
>  
> Sean
>  
>
>  
> On Fri, Feb 8, 2013 at 2:07 PM, Philip Aston <philipa@...
> <mailto:philipa@...>> wrote:
>
>     OK, we can make that simpler :-)
>
>     Checkout the writeToFile function in
>     http://grinder.sourceforge.net/g3/script-gallery.html#http.py
>
>     Extending to fit your interface:
>
>     |def saveHtmlToFile (prefix, response,testId):
>     |
>     |    ||filename = "%s-%d-page-%d.html" %
>     (grinder.processName,testId,grinder.runNumber)|||
>      
>     |    ||file| |=| |open||(filename, ||"w"||)|
>     |    ||print| |>> ||file||, response.text|
>     |    ||file||.close()
>
>         return filename
>     |
>
>
>     - Phil
>
>
>
>     On 08/02/13 16:27, Sean Tiley wrote:
>>     Thanks Phil,
>>      
>>     I have the following
>>      
>>     def saveHtmlToFile (prefix, response,testId):
>>      inputStream = response.getInputStream()
>>      filename = "%s-%d-page-%d.html" %
>>     (grinder.processName,testId,grinder.runNumber)
>>      file = open(filename, "w")
>>      i = 1
>>      cc = inputStream.available()
>>      while (i <= cc):
>>       c = inputStream.read()
>>       file.write("%c" % c)
>>       i += 1
>>      inputStream.close()
>>      file.close()
>>      return filename
>>
>>     When this writes out from the byte array I get not text but a
>>     bunch of weird characters ...9???K?0 ???C?I/mus8? ??? 7?)
>>     Is there something else i need to do to get the english / decoded
>>     test?  Is the result the way it is because i am using https?
>>      
>>     Thanks
>>     Sean
>>     On Fri, Feb 8, 2013 at 11:12 AM, Philip Aston <philipa@...
>>     <mailto:philipa@...>> wrote:
>>
>>         toString() just gives you the headers. getText() will give
>>         you the body as a String, getData() will give it you as a
>>         byte array.
>>
>>         See
>>         http://grinder.sourceforge.net/g3/script-javadoc/HTTPClient/HTTPResponse.html.
>>
>>         There are also some simple helper methods in HTTPUtilities -
>>         http://grinder.sourceforge.net/g3/script-javadoc/net/grinder/plugin/http/HTTPUtilities.html
>>
>>         - Phil
>>
>>
>>         On 08/02/13 15:07, Sean Tiley wrote:
>>>         Hello,
>>>         I am using the Grinder(3.11) to generate load for a web site
>>>         I am testing (https).  i have used the proxy to record some
>>>         basic interactions with the site and now I have been trying
>>>         to find a way to inspect the HTML response using the grinder
>>>         and for the life of me I can not find or figure it out.
>>>          
>>>         I can certainly log infor from the response using
>>>          log(result.toString())
>>>          log(result.getText())
>>>         But I believe this is just the headers.  I want to check the
>>>         HTML response for a string if possible.
>>>          
>>>         Can this be done?
>>>          
>>>         Any thoughts greatly appreciated.
>>>
>>>         -- 
>>>         Sean Tiley
>>>         sean.tiley@... <mailto:sean.tiley@...>
>>
>>
>>
>>
>>     -- 
>>     Sean Tiley
>>     sean.tiley@...
<mailto:sean.tiley@...> 
>
>
>
>
> -- 
> Sean Tiley
> sean.tiley@...
<mailto:sean.tiley@...> 

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
Sean Tiley | 8 Feb 16:07 2013
Picon

Inspect HTML response

Hello,
I am using the Grinder(3.11) to generate load for a web site I am testing (https).  i have used the proxy to record some basic interactions with the site and now I have been trying to find a way to inspect the HTML response using the grinder and for the life of me I can not find or figure it out.
 
I can certainly log infor from the response using
 log(result.toString())
 log(result.getText())
But I believe this is just the headers.  I want to check the HTML response for a string if possible.
 
Can this be done?
 
Any thoughts greatly appreciated.
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use
Aris Green | 8 Feb 06:28 2013
Picon

Need help with custom statistics and totals

Hello, I created a test and I instrumented a function that downloads a
several large file in chunks that I hash as I download.  I through the
file way, because all I care about is the hash which I can use to very
against a known value.  I created the following statistic to add up
the total number of bytes each time this instrumented function is
called to download and hash different files.

grinder.statistics.registerDataLogExpression("Bytes Downloaded", "userLong0")
grinder.statistics.registerSummaryExpression("All Bytes Downloaded",
"(+ userLong0)")

After a file is downloaded, I call

grinder.statistics.forCurrentTest.addLong("userLong0", totalRead)

this also seems to work the same in this case as if I had called
"setLong" where totalRead is the number of bytes for the download.
The summary on the console seems to be updated with the grand total of
all bytes downloaded which is what I want, but the final Totals row
has a different value that is always less.  I am trying to figure out
what is going on.  I have already read the documentation on custom
statistics and looked at example scripts.  I have even searched all
over Google and Bing for better explanations of custom Grinder
statistics but can't seem to find much.  Is there something I need to
change in my call to registerSummaryExpress()?  I tried "(sum
userLong0)" for the expression but that threw an exception.

I would like to get a better grasp on Grinder statistics.  The docs
say that the expression syntax follows a fixed point format, but it
does not seem to exactly match the Reverse Polish Notation fixed point
notation where the values are pushed onto a "stack" before the
operations are called.  The Grinder expression syntax seems to have
the operator first, with the operands following.  If I could be
referred to a something like a Wiki to fully understand the fixed
point notation convention used for the expression syntax, that would
be great.  Maybe the expression syntax is just unique to the Grinder.

Any help is appreciated.
Thanks,
Aris

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb

Gmane