# how to perform spike testing with gatling

**URL:** <https://community.gatling.io/t/how-to-perform-spike-testing-with-gatling/4650>\
**Category:** Gatling (Open-Source)\
**Created:** [November 15, 2018, 10:15pm UTC](https://community.gatling.io/t/how-to-perform-spike-testing-with-gatling/4650 "2018-11-15T22:15:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lawrence\_Ik](https://avatars.discourse-cdn.com/v4/letter/l/a4c791/32.png) [@Lawrence\_Ik](https://community.gatling.io/u/Lawrence_Ik)\
**Post date:** [November 15, 2018, 10:15pm UTC](https://community.gatling.io/t/how-to-perform-spike-testing-with-gatling/4650/1 "2018-11-15T22:15:52Z")

</div>

I was looking for a way to ramp up from 1 to 30 requests per second for a duration of 3 hours. Could the code below be the right way to do this?

rampUsersPerSec(1) to (30) during(3 hours)

Also, could anyone point me to how I could simulate a spike test. using the injection? Could the example below be an example of a spike test:

setUp(scenarioBuilder.inject(constantUsersPerSec(100) during(30 minutes)).throttle(  
reachRps(100) in (10 seconds),  
holdFor(2 minutes),  
jumpToRps(50),  
holdFor(3 hours)  
)
