Re: Fwd: Fwd: helloworld.py example execution

Philip Aston <[email protected]>
Newsgroups gmane.comp.java.grinder.user
Message-ID <[email protected]>
I'm guessing you worked his out?

In your helloworld.py ....

    ==> helloworld.py
    from net.grinder.script.Grinder import grinder
    from net.grinder.script import Test
    log = grinder.logger.info <http://grinder.logger.info>
    test1 = Test(1, "Log method")
    test1.record(log)
    class TestRunner:

        def __call__(self):
            test1("Hello World")

your are calling the Test object. This isn't valid. Instead, you use the
Test object to add instrumention to other methods, functions, and
objects, and call those directly. Please refer back to the original
helloworld.py for an example.

- Phil

On 26/09/13 15:28, Salma Bouriat wrote:
> Thank you all for your answers, but I managed to make it work ^^, but
> I am stuck again
> This time, I think the problem is coming from the helloworld.py file
> because the log of one worker is as follows and the same error repeats
> itself. It will put the helloworld.py file I am using as attachment.
> Thank you again.
>
> 2013-09-26 13:40:30,974 INFO  user-PC-0 : The Grinder version 3.11
> 2013-09-26 13:40:30,978 INFO  user-PC-0 : Java(TM) SE Runtime
> Environment 1.7.0_40-b43: Java HotSpot(TM) Client VM (24.0-b56, mixed
> mode) on Windows 7 x86 6.1
> 2013-09-26 13:40:30,982 INFO  user-PC-0 : time zone is WEST (+0100)
> 2013-09-26 13:40:31,142 INFO  user-PC-0 : worker process 0 of agent
> number 0
> 2013-09-26 13:40:31,263 INFO  user-PC-0 : instrumentation agents: byte
> code transforming instrumenter for Jython 2.5; byte code transforming
> instrumenter for Java
> 2013-09-26 13:40:33,522 INFO  user-PC-0 : running "helloworld.py"
> using Jython 2.5.3 (2.5:c56500f08d34+, Aug 13 2012, 14:54:35) 
> [Java HotSpot(TM) Client VM (Oracle Corporation)]
> 2013-09-26 13:40:33,575 INFO  user-PC-0 thread-1: starting, will do 3 runs
> 2013-09-26 13:40:33,577 INFO  user-PC-0 thread-0: starting, will do 3 runs
> 2013-09-26 13:40:33,579 INFO  user-PC-0 thread-2: starting, will do 3 runs
> 2013-09-26 13:40:33,579 INFO  user-PC-0 thread-3: starting, will do 3 runs
> 2013-09-26 13:40:33,579 INFO  user-PC-0 thread-4: starting, will do 3 runs
> 2013-09-26 13:40:33,579 INFO  user-PC-0 : start time is 1380199233580
> ms since Epoch
> 2013-09-26 13:40:33,595 ERROR user-PC-0 thread-1 [ run-0 ]: aborted
> run - Jython exception, <type 'exceptions.TypeError'>:
> 'net.grinder.script.Test' object is not callable [calling TestRunner]
> net.grinder.scriptengine.jython.JythonScriptExecutionException: <type
> 'exceptions.TypeError'>: 'net.grinder.script.Test' object is not callable
> test1("Hello World")
> File
> "C:\Users\user\Desktop\grinder-3.11\.\user-PC-file-store\current\helloworld.py",
> line 31, in __call__
> 2013-09-26 13:40:33,601 ERROR user-PC-0 thread-2 [ run-0 ]: aborted
> run - Jython exception, <type 'exceptions.TypeError'>:
> 'net.grinder.script.Test' object is not callable [calling TestRunner]
> net.grinder.scriptengine.jython.JythonScriptExecutionException: <type
> 'exceptions.TypeError'>: 'net.grinder.script.Test' object is not callable
> test1("Hello World")
> File
> "C:\Users\user\Desktop\grinder-3.11\.\user-PC-file-store\current\helloworld.py",
> line 31, in __call__
> 2013-09-26 13:40:33,595 ERROR user-PC-0 thread-3 [ run-0 ]: aborted
> run - Jython exception, <type 'exceptions.TypeError'>:
> 'net.grinder.script.Test' object is not callable [calling TestRunner]
> net.grinder.scriptengine.jython.JythonScriptExecutionException: <type
> 'exceptions.TypeError'>: 'net.grinder.script.Test' object is not callable
> test1("Hello World")
>
>
>
> On Thu, Sep 26, 2013 at 3:02 PM, Marc Holden <[email protected]
> <mailto:[email protected]>> wrote:
>
>     I am not seeing the distribution directory being set in your
>     screen shot...  has it been set?
>
>     |% curl -H "Content-Type: application/json" -X PUT
>     http://localhost:6373/properties|
>     |    ||-d '{"distributionDirectory":"examples",
>     "propertiesFile":"grinder.properties"}'|
>      
>     |{"propertiesFile":"grinder.properties","distributionDirectory":"examples"}|
>
>
>
>
>     On Thu, Sep 26, 2013 at 5:40 AM, Gary Mulder
>     <[email protected] <mailto:[email protected]>> wrote:
>
>         Try putting teh full path to the helloworld.py script in your
>         grinder config file. From memory it looks for the file
>         relative to where you are running Grinder.
>
>         Gary
>
>
>

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk

_______________________________________________
grinder-use mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/grinder-use
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.