8000 #18 - adding generic benchmark csv feed · soujava/soujava-test-kit@b57794f · GitHub
[go: up one dir, main page]

Skip to content

Commit b57794f

Browse files
#18 - adding generic benchmark csv feed
1 parent 5d9e861 commit b57794f

File tree

3 files changed

+48
-2
lines changed

3 files changed

+48
-2
lines changed

gatling/readme.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ mvn gatling:execute -Dgatling.simulationClass=soujava.BenchmarkGeneric -DNUM_THR
123123
outputs
124124
```
125125
126-
$ mvn gatling:execute -Dgatling.simulationClass=soujava.BenchmarkGeneric -DNUM_THREADS=100 -DRAMP_TIME=100 -DDURATION=60 -DTARGET=http://vertx-simple-json-endpoint.herokuapp.com -DENDPOINT=/hello -DENDPOINT_NAME=HELLO_WORLD_VERTEX
126+
mvn gatling:execute -Dgatling.simulationClass=soujava.BenchmarkGeneric -DNUM_THREADS=100 -DRAMP_TIME=100 -DDURATION=60 -DTARGET=http://vertx-simple-json-endpoint.herokuapp.com -DENDPOINT=/hello -DENDPOINT_NAME=HELLO_WORLD_VERTEX
127127
[INFO] Scanning for projects...
128128
[INFO]
129129
[INFO] ------------------------------------------------------------------------
@@ -196,16 +196,24 @@ Please open the following file: /opt/scala/scala-gatling-bootstrap-mvn/target/ga
196196
[INFO] ------------------------------------------------------------------------
197197
```
198198

199+
Running generic benchmark feed race_for_speed.csv:
200+
Java Vertex VS Scala VS Nodejs VS Golang
201+
```
202+
mvn gatling:execute -Dgatling.simulationClass=soujava.BenchmarkGenericFeed -DNUM_THREADS=1 -DRAMP_TIME=1 -DDURATION=60 -DTARGET=race_for_speed.csv -DENDPOINT_NAME=vertexVSscalaVSnodejsVSgolang
203+
```
204+
199205

200206
Running Tests for Websocket
201207
============
202208
TODO: Work in progress
203-
209+
[#20](https://github.com/soujava/soujava-test-kit/issues/20)
204210

205211

206212
Running Tests for JMS
207213
============
208214
TODO: Work in progress
215+
[#19](https://github.com/soujava/soujava-test-kit/issues/19)
216+
209217

210218

211219

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
url,name
2+
http://vertx-simple-json-endpoint.herokuapp.com/hello,vertex
3+
http://sheltered-tor-1754.herokuapp.com/hello,scala
4+
http://desolate-harbor-2201.herokuapp.com/hello,nodejs
5+
http://limitless-basin-5531.herokuapp.com/hello,golang13
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* @author: Thomas Modeneis
3+
*/
4+
package soujava
5+
6+
import scala.concurrent.duration._
7+
import io.gatling.core.Predef._
8+
import io.gatling.http.Predef._
9+
import io.gatling.jdbc.Predef._
10+
11+
class BenchmarkGenericFeed extends Simulation {
12+
13+
def threads_ = System.getProperty("NUM_THREADS")
14+
def rampup_ = System.getProperty("RAMP_TIME")
15+
def duration_ = System.getProperty("DURATION")
16+
def target = System.getProperty("TARGET")
17+
def endpointName_ = System.getProperty("ENDPOINT_NAME")
18+
19+
val threads = Integer.getInteger("threads", threads_.toInt)
20+
val rampup = Integer.getInteger("rampup", rampup_.toInt).toInt
21+
val duration = Integer.getInteger("duration", duration_.toInt).toInt
22+
23+
val feeder = csv(target).random
24+
25+
val get_endpoint = feed(feeder).exec(http("${name}").get("${url}"))
26+
27+
val scn = scenario(endpointName_)
28+
.forever("counter") {
29+
randomSwitch(100.0 -> get_endpoint)
30+
}
31+
setUp(scn.inject(rampUsers(threads) over rampup))
32+
.maxDuration(duration)
33+
}

0 commit comments

Comments
 (0)
0