The Grinder - unknown token 'timedTests'

79 Views Asked by At

I'm trying to run some simple tests with Grinder. I'm using the JMSReceiver script from the Script Gallery and trying to add some statistics, but my Agent throws an exception when it starts up.

A trivial example is:

from net.grinder.script.Grinder import grinder
from net.grinder.script import Test

grinder.statistics.registerSummaryExpression("foo","(/ userLong0 timedTests)")

Running this throws an exception:

...Parse exception: Unknown token 'timedTests', at character 23 of '(/ userLong0 timedTests)'

I'm using grinder-3.11, jython-2.5.3, and I'm running the above Grinder script with:

CLASSPATH=lib/jython-standalone-2.5.3.jar:lib/grinder.jar
java -classpath $CLASSPATH net.grinder.Grinder etc/grinder.properties

where grinder.properties specifies the script to run.

Java version is "1.7.0_03-icedtea", which I think is JDK 7u60 on Centos 6.3.

1

There are 1 best solutions below

0
On BEST ANSWER

About 5 minutes after posting the question, I found this wiki page. I don't know if it's the version of Grinder that I'm using, but in order to get this to work I have to change

grinder.statistics.registerSummaryExpression("foo","(/ userLong0 timedTests)")

to

grinder.statistics.registerSummaryExpression("foo","(/ userLong0 (count timedTests))")

The important difference being the addition of the "count" token. This solves my problem.