Gatling UUID feeder

A UUID generator for the Gatling Stress Testing tool.

1
2
3
4
5
6
7
8
9
object UuidFeeder {
    val feeder = new Feeder[String] {
        override def hasNext = true
 
        override def next: Map[String, String] = {
            Map("uuid" -> UUID.randomUUID.toString());
        }
    }
}

override def next: Map[String, String] = {
Map("uuid" -> UUID.randomUUID.toString());
}
}
}

which can then be used in a Gatling scenario like:-

1
2
3
4
5
6
7
8
9
10
   val scn = scenario("GUID registration")
      .during(10 minutes) {
         feed(UuidFeeder.feeder)
         .exec(
         http("Register GUID")
         .get("/registerGuid")
         .queryParam("guid", "${uuid}")
         .check(regex("guid"))
         )
      }

This is my personal blog - all views are my own.

Tagged with: , , ,