On 01/05/2011 12:09 PM, zhouyuan wrote: > > Hi guys, > > I want to use a BeanShell Timer to get dynamical think time in transactions. > Now I'm trying to use BeanShell PreProcessor and BeanShell PostProcessor in > a transaction to get the start and end timestamp like the following: > > long time2; > ${__time(,time2)}; > ${__log(${time2},OUT)}; > long response = Long.parseLong(${time2})-Long.parseLong(${time1}); > long response1 = ${time2}-${time1}; > ${__log(${response},OUT)}; > ${__log(${response1},OUT)}; > > But it always logs an error like this: > > 2011/01/05 17:53:20 WARN - jmeter.extractor.BeanShellPostProcessor: P > roblem in BeanShell script org.apache.jorphan.util.JMeterException: Error > invoking bsh method: eval Parse error at line 2, column 1 : Error or > number too big for integer type: 1294221200196 > > How could I defined the variables in long format or is there other ways to > get transaction time and use it in a timer?
I cannot really see where you're going with this, but I do note that you are probably working with a milliseconds timestamp there. Try chopping off the last three digits to convert it to a seconds timestamp. That way, it should parse to a long just fine. Otherwise, doesn't Java have a "long long" type? Don't ask me how to parse those, though. HTH, Felix --------------------------------------------------------------------- To unsubscribe, e-mail: jmeter-user-unsubscr...@jakarta.apache.org For additional commands, e-mail: jmeter-user-h...@jakarta.apache.org