oliverlloyd / jmeter-ec2

Automates running Apache JMeter on Amazon EC2
GNU General Public License v3.0
464 stars 187 forks source link

Error on floating point arithmetic #83

Closed avmohan closed 7 years ago

avmohan commented 7 years ago

./jmeter-ec2.sh: line 81: 0 + 3.6: syntax error: invalid arithmetic operator (error token is ".6") Bash doesn't understand floating pt arithmetic.

benztest commented 7 years ago

I've received the same issue as well.

Line 81 points to echo $[$1 + $2] in the jmeter-ec2.sh file

I've temporarily replaced the lines that use 'add' to an older release. (example)

#count_overallhosts=$(add $count_overallhosts $count_total)

to

count_overallhosts=$(echo "$count_overallhosts+$count_total" | bc)

This bypasses the error report in console when executing.

avmohan commented 7 years ago

Yeah.. I had changed the add function itself to use bc

oliverlloyd commented 7 years ago

This sound like a regression bug. I knew there was a reason I'd used bc... @benztest or @abhi92, Do you want to put that fix into a pull request and I'll merge it in. I think it would be good to keep the add() function though, for neatness.

benztest commented 7 years ago

@oliverlloyd sure, I'll give it ago.

oliverlloyd commented 7 years ago

Closed by PR #84