Ouray Viney | 14 Dec 04:29 2012
Picon

Grinder Error Handling

Hi All:


I would like to be able to control how far a script continues based on errors observed.  For example, a thread is seeing critical errors I would like to have the script exit, skipping the remaining steps i.e. the remainder of the run/iteration.  The reason for this requirement is simple; less bogus exceptions in the Grinder logs and server application logs.  Resulting in less time wasted finding real issues.

I have read the Grinder API docs and have experimented with the stopThisWorkerThread() method.  The only issue I have with the end result is that the failure statistics are dropped i.e they aren't recorded.  Though if required, one could calculate the failures based on the (total passes - total failures).

I would like to avoid having to wrap logic in the __call__ method with conditionals based on test results from previous tests as this just adds to the scripts maintenance requirements.  This is however a viable option, though I prefer the ability to call stopThisWorkThread().

Phil, what are your thoughts?  Am I using the correct API for my business requirement.  

Thanks,

--
Ouray Viney
http://www.viney.ca


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use
Ravi Joshi | 13 Dec 17:45 2012
Picon

Can i assign more than one thread for one session in Agents?

One of web application have notification process, which continues runs parallel to the application. This process is same as that of notification process in Facebook. This process doesn't make confiscations in user's activity. However if there is any new changes, it just shows an information about the same. In our application, this notification process waits for some amount of time, then dispatch all the notifications to user.

I recorded the entire scenario using TCPProxy and run it. After analyzing the log file, i got to know that entire application is waiting till the specific amount of time (defined for notifications) then executes further requests.

How can i assign a separated thread to this notification process, so that it can run in background without distributing the further requests?

Is there any property in grinder, which can solve my purpose?

-Ravi
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use
Ravi Joshi | 13 Dec 17:32 2012
Picon

TCPProxy is not recording correctly

I am using TCPProxy to record some scripts. However sometimes it is not creating the script properly.

Since token_isc_metaDataPrefix is not instantiated before, I am getting an error with the recorded script. Below is error snippet-

2-12-12 15:51:36,341 ERROR internal-0 thread-0 [ run-0 ]: aborted run - Jython exception, <type 'exceptions.AttributeError'>: TestRunner instance has no attribute 'token_isc_metaDataPrefix' [calling TestRunner]
net.grinder.scriptengine.jython.JythonScriptExecutionException: <type 'exceptions.AttributeError'>: TestRunner instance has no attribute 'token_isc_metaDataPrefix'
        result = request4701.GET('/home/services/addFriend/sendReq' +
        File "/opt/grinderAgent/temp/../recordedScripts/sendRequest.py", line 1455, in page47
        self.page47()     # GET sendReq (request 4701)
        File "/opt/grinderAgent/temp/../recordedScripts/sendRequest.py", line 2292, in __call__
       
I am putting the recorded code corresponding to the above error    below-

  def page47(self):
    """GET sendReq (request 4701)."""
    self.token__operationType = \
      'fetch'
    self.token__startRow = \
      '0'
    self.token__endRow = \
      '75'
    self.token__textMatchStyle = \
      'exact'
    self.token__componentId = \
      'isc_JobMonitorGrid_0'
    result = request4701.GET('/home/services/addFriend/sendReq' +
      '?_operationType=' +
      self.token__operationType +
      '&_startRow=' +
      self.token__startRow +
      '&_endRow=' +
      self.token__endRow +
      '&_textMatchStyle=' +
      self.token__textMatchStyle +
      '&_componentId=' +
      self.token__componentId +
      '&_dataSource=' +
      self.token__dataSource +
      '&isc_metaDataPrefix=' +
      self.token_isc_metaDataPrefix +
      '&isc_dataFormat=' +
      self.token_isc_dataFormat, None,
      ( NVPair('If-Modified-Since', 'Thu, 01 Jan 1970 00:00:00 GMT'), ))

    return result


token_isc_metaDataPrefix is instantiated after this page in page48.

Why TCPProxy is not creating the script properly?

-Ravi
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use
Ravi Joshi | 13 Dec 17:08 2012
Picon

grinder.duration=123 property is not working with Console

Recently to I wanted to run multiple Agents from Console for some duration but coudn't. The grinder.duration=123 property was not effective from Console.

Is this property only works with single Agents or do i need to do some modification in grinder.properties file?

-Ravi
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use
Ravi Joshi | 9 Dec 22:51 2012
Picon

Modifying logging mechanism

Can I modify logback-worker.xml file to generate new log file for ERROR only and ${PREFIX}.log file should contain no ERROR?

Which appender is useful and what about the rollingPolicy for the same?


-Ravi

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use
Tani | 5 Dec 18:52 2012
Picon

Failed to determine proxy destination.


C:\>java net.grinder.TCPProxy -console -http > "Program
Files\grinder-3.11\examples"\OOPReg.py
13:45:14.750 [main] INFO : Initialising as an HTTP/HTTPS proxy with the
parameters:
   Request filters:    HTTPRequestFilter
   Response filters:   HTTPResponseFilter
   Local address:      localhost:8001
13:45:15.015 [main] INFO : Engine initialised, listening on port 8001
13:45:30.171 [main] ERROR: Failed to determine proxy destination.
Client opened connection but sent no bytes.

13:45:35.546 [main] ERROR: Failed to determine proxy destination.
Client opened connection but sent no bytes.

13:45:40.921 [main] ERROR: Failed to determine proxy destination.
Client opened connection but sent no bytes.

13:45:46.281 [main] ERROR: Failed to determine proxy destination.
Client opened connection but sent no bytes.

13:47:13.984 [main] INFO : Engine exited

My firewall is turned off, my proxy in firefox 15 is set to 8001 for http,
it was working fine yesterday.  The scripts still get recorded but after a
minute or so it turns itself off, even though I haven't completed what I
want the script to record.

Thanks in advance
--

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

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
DTouzet | 5 Dec 17:33 2012
Picon

[Gringer-3.4]Pb testing a webapp using digest authentication

Hi,

I face problems when trying to test my webapp using Digest authentication.
Tests script has been captured using the TCPProxy and adapted in order to deal with authentication (see below for code excerpt).

HTTP request (1) is OK .
HTTP request (2) (same as the first one) is OK.
HTTP request (3) returns a 401
=> Value of digest authentication field "nc" was back to "00000001" in this 3rd request, which, I assume, is not the expected value at this stage.

For information, tests are OK when the webapp is deployed and configured using the BASIC authentication scheme.
For this purpose, I only change :
AuthorizationInfo.addDigestAuthorization(Settings.host, Settings.nuPort, Settings.realm, Settings.usr, Settings.pwd, threadContextObject)
into :
AuthorizationInfo.addBasicAuthorization(Settings.host, Settings.nuPort, Settings.realm, Settings.usr, Settings.pwd, threadContextObject)

Any ideas ?

Regards,
David



from net.grinder.script import Test
from net.grinder.script.Grinder import grinder
from net.grinder.plugin.http import HTTPPluginControl, HTTPRequest
from HTTPClient import NVPair, AuthorizationInfo

connectionDefaults = HTTPPluginControl.getConnectionDefaults()
connectionDefaults.setUseAuthorizationModule(1)

...

  def __call__(self):
    """This method is called for every run performed by the worker thread."""
    threadContextObject = HTTPPluginControl.getThreadHTTPClientContext()
    #AuthorizationInfo.addDigestAuthorization(Settings.host, Settings.nuPort, Settings.realm, Settings.usr, Settings.pwd, threadContextObject) # BASIC authentication
    AuthorizationInfo.addBasicAuthorization(Settings.host, Settings.nuPort, Settings.realm, Settings.usr, Settings.pwd, threadContextObject) # DIGEST authentication
   
    self.page1()      # GET xxx.jsf (request 101)

    grinder.sleep(1591)
    self.page2()      # GET xxx.jsf (request 201)

    grinder.sleep(78)
    self.page3()      # GET yyy.jsf (request 301)
    ...
    (many more tests)

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use
Tanya Harper | 4 Dec 20:47 2012
Picon

Oracle Sequences and ID generation

I am creating a script to insert a new record into an oracle database that has sequences on the tables.  For fields that are not albe to be duplicated I am doing the following:

 usernames = {
    "1"     : Test(1, "THPP1"),
    "2"     : Test(2, "THPP2"),
    "3"     : Test(3, "THPP3"),
    "4"   : Test(4, "THPP4"),
    "5" : Test(5, "THPP5"),
}


and later on n the self.token_operation

 NVPair('username', random.choice(usernames.keys())),

My issue that I think I am having is the record isn't getting created because I dropped the NVPair for the id field due to it being a sequence, but the records don't seem to be getting added.  (I need to simulate 80 users entering a record at the same time.)  Could anyone tell me how to set the sequence for each thread

Thanks

Tani
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use
Ravi Joshi | 29 Nov 15:03 2012
Picon

grinder.numberOfOldLogs is not working in The Grinder 3.11

Why grinder.numberOfOldLogs=20 is not working with The Grinder 3.11? Is it deprecated now? I need it badly.

-
Regards
Ravi
------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use
Ravi Joshi | 28 Nov 19:13 2012
Picon

Can I start agent process directly from console?

Hi, Can I start agent process directly from console in The Grinder 3.11?

-
Thanks
Ravi
------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use
Philip Aston | 25 Nov 17:53 2012
Picon

Re: MavenJython Plugin and Grinder

OK - that's good to hear. I guess you'll contribute your patches back to the g-m-p?

- Phil

On 22/11/12 12:55, Kelvin Ward wrote:
Thanks for the help Phil.

I've just done some patching to the Grinder Maven plugin at http://code.google.com/p/grinder-maven-plugin and got it to do everything I want so far without using the uberjar approach. The Grinder Maven plugin does everything except for pulling in versioned python artifacts for which the MavenJython plugin can still be used. 

On 20 November 2012 18:54, Philip Aston <philipa-O5WfVfzUwx8@public.gmane.org> wrote:

The Grinder expects the agent jar to be available somewhere next to grinder.jar.

It looks for it by walking the system classpath, expanding each entry to include the peers in the same directory, and for each peer, checking whether its name matches a regular expression (^grinder-dcr-agent-([\\d.]*)(-.*)?.jar$).

So, you may get somewhere if you place the agent jar somewhere and include it in the classpath. E.g.

java -cp /somewhere/grinder-dcr-agent-3.11.jar -jar my-uberjar-with-dependencies.jar

- Phil


On 01/11/12 12:15, Kelvin Ward wrote:

Hi

I’m trying to use the maven/jython tooling at http://mavenjython.sourceforge.net/. The MavenJython packaging allows one to use maven to fetch and version java and python libraries – e.g. pulling in jars from maven central and python libraries from pypi or whatever respository you use. A jython installation, its standard libraries as well as the java and jython libraries specified in the maven pom file can be built into one uberjar – jar with dependencies.

I’ve tried doing this using grinder as the main class of the uberjar by specifying net.grinder.Grinder as the mainClass used by the maven-assembly-plugin. The jar is built with ’mvn package’ and we have in the same folder something like:

grinder.properties

grinder.py

my-uberjar-with-dependencies.jar

There are not any python/java source files of interest in the pom project – this is just a skeleton test, but it does pull in an external python library as part of this test.

We then try to run it (a trivial http GET test), which produces an error in the log file:

java –jar my-uberjar-with-dependencies.jar

 

2012-10-31 11:12:07,103 INFO  HAM12763-0 : The Grinder version 3.11

2012-10-31 11:12:07,106 INFO  HAM12763-0 : Java(TM) SE Runtime Environment 1.6.0_29-b11: Java HotSpot(TM) 64-Bit Server VM (20.4-b02, mixed mode) on Windows 7 amd64 6.1

2012-10-31 11:12:07,108 INFO  HAM12763-0 : time zone is GMT (+0000)

2012-10-31 11:12:07,129 INFO  HAM12763-0 : Java VM does not support instrumentation, DCR unavailable

2012-10-31 11:12:07,144 INFO  HAM12763-0 : worker process 0

2012-10-31 11:12:07,151 INFO  HAM12763-0 : instrumentation agents: NO INSTRUMENTER COULD BE LOADED

2012-10-31 11:12:08,811 INFO  HAM12763-0 : registered plug-in net.grinder.plugin.http.HTTPPlugin

2012-10-31 11:12:08,825 ERROR HAM12763-0 : aborting process - Java exception initialising test script

 

Now I think this is because in the normal grinder distribution the standalone grinder-dcr-agent.jar is clearly not packaged within an uberjar and has a special manifest with:

Premain-Class: net.grinder.util.weave.agent.ExposeInstrumentation

Can-Redefine-Classes: true

Can-Retransform-Classes: true

Adding this to the pom didn't help:

build/plugin/configuration/archive ->

<manifestEntries>
  <Premain-Class>net.grinder.util.weave.agent.ExposeInstrumentation</Premain-Class>
  <Can-Redefine-Classes>true</Can-Redefine-Classes>
  <Can-Retransform-Classes>true</Can-Retransform-Classes>
</manifestEntries>

Is it possible to get Grinder working from within an uberjar?

I’ve attached pom.xml based off the demo project at mavenjython.sourceforge, grinder script, properties and the log file.

 

Thanks,

Kelvin Ward.





------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
grinder-use mailing list
grinder-use@...
https://lists.sourceforge.net/lists/listinfo/grinder-use

Gmane