excilys/gatling — pull request #530 by skuenzli (2012-05-29 02:58:12+00:00)
Title: Feature: pauseExp - pause using exponentially distributed delays

Add a 'pauseExp' action to allow simulations to include pauses based on an exponential distribution of delays.

Example using exponentially-distributed pauses with a mean of 100ms:
```
http("homepage")
.get("/sample-webapp/")
.check(status.in(List(200, 503))))
.pauseExp(100, MILLISECONDS)
```

The implementation and testing of the exponential number generation relies on Apache Commons Math, v3 (http://commons.apache.org/math/). Testing of NumberHelper.create*Generator functions is done via commons-math.

Significant changes:
1. In order to simplify implementation of pause actions and improve efficiency of random number generation, PauseAction.scala has modified to accept a function that can be used to generate a delays for the pause action.
2. NumberHelper has been modified to create functions that can be invoked to retrieve a random number for use with PauseAction. Previously, NumberHelper hosted functions that generated random numbers.

Existing simulations should not be affected by this change, as PauseActionBuilder [still] creates uniformly-distributed pauses, not exponentially-distributed ones.

Details of commit creation
--------------------------

This commit was created via a merge --squash of a feature branch to a clean tracking branch of excilys/master:

commit 6feaac33a6d375dcb058005c4b5f2cd65ae2c7f3
Merge: 6536887 60d38d7
Author: Stephen Kuenzli
Date: Mon May 28 17:54:23 2012 -0700

Merge branch 'master' of git://github.com/excilys/gatling into feature-pause-exponential-dist

commit 6536887cbc0bbeb3f6c737ff98910519f901210c
Author: Stephen Kuenzli
Date: Mon May 28 17:18:45 2012 -0700

Re-implement pause builders to create PauseActions with delay generators created using the NumberHelper.

commit 1c4804e2f46f8cc84fe4fc26125acc61b56350a7
Author: Stephen Kuenzli
Date: Mon May 28 16:16:40 2012 -0700

minor formatting clean-up

commit 37d47bb7c2608c3430e84db694dea16835216741
Author: Stephen Kuenzli
Date: Mon May 28 16:15:46 2012 -0700

Create factories for creating number generators. Re-implement getRandom* in terms of these functions.

commit 234d441a77afe4d1262c75c65ab8a4f4409e01d7
Author: Stephen Kuenzli
Date: Sun May 27 13:34:50 2012 -0700

Relax thresholds to ensure reliable test execution.

commit f89f106e0f38e983fddf4710d65feba4950238c7
Author: Stephen Kuenzli
Date: Sun May 27 13:27:34 2012 -0700

Resolve conflict that was missed on merge.

commit eacd25e0cec1b71072c737bbf106abffccb172d2
Merge: c2efa51 b076a9c
Author: Stephen Kuenzli
Date: Sun May 27 13:24:45 2012 -0700

Merging b076a9c: Extract a PauseAction trait and use it in [Uniform|Exp]PauseAction

commit c2efa51bdb07aae91911622021568c86d2c8cf52
Merge: b84be33 38d1dc2
Author: Stephen Kuenzli
Date: Sun May 27 13:24:19 2012 -0700

Merging 38d1dc2: Rename PauseAction to UniformPauseAction so that a PauseAction trait can be introduced.

commit b84be33905014e0449d2cfc0a6e6c990146c8f46
Merge: f87f43d 9eb1d32
Author: Stephen Kuenzli
Date: Sun May 27 13:18:50 2012 -0700

Merge branch 'master' of git://github.com/excilys/gatling into feature-pause-exponential-dist

commit b076a9c8fb380812482f1a56127d378fa3bc313c
Author: Stephen Kuenzli
Date: Sun May 27 10:47:54 2012 -0700

Extract a PauseAction trait and use it in [Uniform|Exp]PauseAction

commit 38d1dc2ba6270275896ad8fdb6e658a6cb16b335
Author: Stephen Kuenzli
Date: Sun May 27 09:59:46 2012 -0700

Rename PauseAction to UniformPauseAction so that a PauseAction trait can be introduced.

commit 4d2bd4593baec8f34d44d0e6554f8309bc1e03c4
Merge: b67aa2f 08095b4
Author: Stephen Kuenzli
Date: Sun May 27 09:38:43 2012 -0700

Merging from excilys/master

commit f87f43d3a6246cab45eab13b5f8ac4e37378dd46
Merge: a9a36f3 4b276e9
Author: Stephen Kuenzli
Date: Wed May 23 21:52:48 2012 -0700

Merge branch 'master' of git://github.com/excilys/gatling into feature-pause-exponential-dist

commit b67aa2ffbecc2e06f7a8f836cd0841a1d904a80b
Merge: 7c46182 4b276e9
Author: Stephen Kuenzli
Date: Wed May 23 21:47:44 2012 -0700

Merge branch 'master' of git://github.com/excilys/gatling

commit a9a36f3c5fef54e99ee63fc0fa9a10f8645c86fe
Merge: b5a1759 6ca9b2d
Author: Stephen Kuenzli
Date: Mon May 21 21:09:39 2012 -0700

Merge branch 'master' of git://github.com/excilys/gatling into feature-pause-exponential-dist

commit b5a17597e8c0628977ac4f38cc933f50197a3c70
Merge: 21f57a5 7c46182
Author: Stephen Kuenzli
Date: Sun May 20 21:50:51 2012 -0700

Merge commit '7c46182' into feature-pause-exponential-dist

commit 21f57a50575dd93c8112f7efd24320fca6af1f0a
Merge: 4329a97 57844e1
Author: Stephen Kuenzli
Date: Sun May 20 21:50:37 2012 -0700

Merge commit '57844e1' into feature-pause-exponential-dist

commit 4329a978c88f9929aa3cff371e1a993dd8e6477c
Merge: 197eaad 2afaa4a
Author: Stephen Kuenzli
Date: Sun May 20 21:50:22 2012 -0700

Merge commit '2afaa4a' into feature-pause-exponential-dist

commit 197eaad4edb67e8f434153e1a0606624ef1d07ef
Merge: ce357ce dc1090c
Author: Stephen Kuenzli
Date: Sun May 20 21:50:09 2012 -0700

Merge commit 'dc1090c' into feature-pause-exponential-dist

commit ce357ce1d300fc9ba7def796d3ee0245f1e38c21
Merge: c5f8d45 c1c818d
Author: Stephen Kuenzli
Date: Sun May 20 21:49:54 2012 -0700

Merge commit 'c1c818d' into feature-pause-exponential-dist

commit c5f8d454cf941d5404e385c6946ac48110b1746a
Merge: 816c150 e1b6646
Author: Stephen Kuenzli
Date: Sun May 20 21:43:06 2012 -0700

Merging e1b6646 from master. Add 'pauseExp' verb to the DSL to use a pause based on an exponential distribution.

commit 816c1506732e99820d7149d8565f354c6823a868
Merge: 09c32b6 5ad67dd
Author: Stephen Kuenzli
Date: Sun May 20 21:38:36 2012 -0700

Merge commit '5ad67dd' into feature-pause-exponential-dist

commit 09c32b67b339f666f3fa164a6751b93b2b9b4990
Merge: 41f464b 82d3420
Author: Stephen Kuenzli
Date: Sun May 20 21:37:58 2012 -0700

Merging b8782d3420om master. A Add test for NumberHelper.getRandomLongFromExponential().

commit 41f464bc254689773309d8ec14983f2d69b1f29e
Merge: 8f7d857 b879df9
Author: Stephen Kuenzli
Date: Sun May 20 21:33:35 2012 -0700

Merging b879df9 from master. Added getRandomDoubleFromExp and getRandomLongFromExp to NumberHelper. Created tests for NumberHelper.

commit 7c46182186d3902e98ab14962807b2dc38f329dd
Author: Stephen Kuenzli
Date: Sat May 19 23:55:05 2012 -0700

Re-implement getRandomDoubleFromExp using commons-math's ExponentialDistribution.

commit 57844e120e8e8f1e0245d90a36c6df94aab5b274
Author: Stephen Kuenzli
Date: Sat May 19 23:33:55 2012 -0700

Re-implement getRandomLong test using commons-math.

commit 2afaa4af477d3611d5c71284d489f5e73d6e7620
Author: Stephen Kuenzli
Date: Sat May 19 22:53:05 2012 -0700

Re-implement getRandomLongFromExponential test using commons-math.

commit dc1090c5c513f86984157954de7d4f2e02087515
Author: Stephen Kuenzli
Date: Sat May 19 22:15:33 2012 -0700

Re-implement getRandomDoubleFromExponential test using commons-math.

commit c1c818d08e7d5ab6f47edf6d0cea9c7a75ee8452
Author: Stephen Kuenzli
Date: Sat May 19 18:49:51 2012 -0700

Add commons-math3 dependency to gatling-core.

commit d9a11bcb95615e2bb5701c78d167a31156605bf9
Merge: b397744 04a2bfa
Author: Stephen Kuenzli
Date: Sat May 19 18:08:13 2012 -0700

Merge branch 'master' of git://github.com/excilys/gatling

commit b397744ce35405690ca76c72eb4d2f1a4519e22a
Merge: 77b7c06 c8e82f4
Author: Stephen Kuenzli
Date: Tue May 15 21:38:11 2012 -0700

Merging 1.2.0-SNAPSHOT from excilys/master.

commit 77b7c06c9efda666d463e161cc6d17b1edc11386
Merge: 942429d 013dd73
Author: Stephen Kuenzli
Date: Mon May 7 22:07:51 2012 -0700

Merging from git://github.com/excilys/gatling.git

commit 942429d01c7a3276e883d1207dd13df6749a1c56
Author: Stephen Kuenzli
Date: Mon May 7 20:18:37 2012 -0700

Re-add support for excluding simulations which was removed (from branch) inadvertantly. Focus debug logging on effective simulations folder and the simulations that are resolved.

commit a90821eecf75c5c06cc56ed039e696252bbcd0fd
Author: Stephen Kuenzli
Date: Sun May 6 20:47:23 2012 -0700

The DirectoryScanner will normalize include/exclude paths with the appropriate File.separator, so removing for clarity and to eliminate a bug introduced for Windows. One file separator instance was used, but would Windows' file separator needs to be be escaped in a Java string, i.e. doubled to '\\'.

commit ea1468965954b0cd93c52a2cbb7d5e6e306e93e3
Author: Stephen Kuenzli
Date: Sun May 6 20:24:36 2012 -0700

Add debug logging to record effective simulationsFolder and includes settings. Switch to File.separator instead of '/'.

commit 0275fe3f4266cd350cbda1dc7eac79dbe59df306
Merge: d65bec3 72f2066
Author: Stephen Kuenzli
Date: Sun May 6 17:16:08 2012 -0700

Merge branch 'master' of git://github.com/excilys/gatling

commit d65bec3579b323c09c9aace738812deb25912232
Merge: e1b6646 8a013ab
Author: Stephen Kuenzli
Date: Sun May 6 11:31:26 2012 -0700

Merge branch 'master' of git://github.com/excilys/gatling

commit e1b6646befee840a1c2f8e0d59e0ace0fb459331
Author: Stephen Kuenzli
Date: Sun May 6 11:31:21 2012 -0700

Add 'pauseExp' verb to the DSL to use a pause based on an exponential distribution.

commit e56b8cab47c2c016a4f073292fb07462abc30345
Author: Stephen Kuenzli
Date: Sat May 5 21:12:22 2012 -0700

Clean-up ScalaDoc

commit 58ab62ef7c86d4b0d40e3c74476c096b83eb6610
Merge: 5ad67dd a606887
Author: Stephen Kuenzli
Date: Sat May 5 17:59:34 2012 -0700

Merge branch 'master' of git://github.com/excilys/gatling

Resolved Conflicts:
gatling-core/src/main/scala/com/excilys/ebi/gatling/core/util/NumberHelper.scala

Updated:
gatling-charts/pom.xml to use specs2_2.9.2

commit 5ad67dd6a2edf3a92a7a1c750e6608c2999be2ab
Author: Stephen Kuenzli
Date: Sat May 5 16:26:55 2012 -0700

Eliminate truncation of decimal values causing skew toward the minimum value of the range when generating a random long. Improve test to verify random numbers are being generated as a uniform distribution by:
1. generate a number of uniform-random longs in a known range
2. compare average of generated numbers to expected average
3. verify error around expected average is normally distributed

commit 82d34208f65a8ac025f36a1b13345a9ca98527c2
Author: Stephen Kuenzli
Date: Sat May 5 14:19:04 2012 -0700

Add test for NumberHelper.getRandomLongFromExponential().

commit b879df92b8f26fd08c03f144102acbadbfe4ce67
Author: Stephen Kuenzli
Date: Sat May 5 11:06:35 2012 -0700

Added getRandomDoubleFromExp and getRandomLongFromExp to NumberHelper. Created tests for NumberHelper.

commit 1bcefa84a5f660bca766eca68c8ca2317eb40262
Merge: 72d85c5 a495572
Author: Stephen Kuenzli
Date: Sat Apr 21 22:44:53 2012 -0700

Merge branch 'master' of git://github.com/excilys/gatling