Permalink
Browse files

put everything on port 9000 to share a single load-test.jmx

  • Loading branch information...
1 parent 93ecab4 commit 1c7f9f1d84853d56fbdd31d569e2d3d3abfc2479 @earldouglas earldouglas committed Sep 17, 2012
View
@@ -36,7 +36,7 @@ https://github.com/harrah/xsbt/wiki/Getting-Started-Setup
```
```
-jmeter -n -t scamper/blueeyes/load-test.jmx
+jmeter -n -t scamper/load-test.jmx
```
### [Finagle](https://github.com/twitter/finagle)
@@ -46,27 +46,27 @@ jmeter -n -t scamper/blueeyes/load-test.jmx
```
```
-jmeter -n -t scamper/finagle/load-test.jmx
+jmeter -n -t scamper/load-test.jmx
```
### [Lift](https://github.com/lift/lift)
```
-(cd scamper/lift ; sbt "~container:start")
+(cd scamper/lift ; sbt run)
```
```
-jmeter -n -t scamper/lift/load-test.jmx
+jmeter -n -t scamper/load-test.jmx
```
### [Pinky](https://github.com/pk11/pinky)
```
-(cd scamper/pinky ; sbt update ~jetty-run)
+(cd scamper/pinky ; sbt update run)
```
```
-jmeter -n -t scamper/pinky/load-test.jmx
+jmeter -n -t scamper/load-test.jmx
```
### [Play 2.0](https://github.com/playframework/Play20)
@@ -76,7 +76,7 @@ jmeter -n -t scamper/pinky/load-test.jmx
```
```
-jmeter -n -t scamper/play2/load-test.jmx
+jmeter -n -t scamper/load-test.jmx
```
### [Play 2.0 mini](https://github.com/typesafehub/play2-mini)
@@ -86,7 +86,7 @@ jmeter -n -t scamper/play2/load-test.jmx
```
```
-jmeter -n -t scamper/play2-mini/load-test.jmx
+jmeter -n -t scamper/load-test.jmx
```
### [spray-can](https://github.com/spray/spray-can)
@@ -96,7 +96,7 @@ jmeter -n -t scamper/play2-mini/load-test.jmx
```
```
-jmeter -n -t scamper/spray-can/load-test.jmx
+jmeter -n -t scamper/load-test.jmx
```
### Servlet 3.0
@@ -119,7 +119,7 @@ jmeter -n -t scamper/servlet-3.0/scalatra-async-load-test.jmx
```
```
-jmeter -n -t scamper/node.js/load-test.jmx
+jmeter -n -t scamper/load-test.jmx
```
### [Finatra](https://github.com/capotej/finatra)
@@ -129,5 +129,5 @@ jmeter -n -t scamper/node.js/load-test.jmx
```
```
-jmeter -n -t scamper/finatra/load-test.jmx
+jmeter -n -t scamper/load-test.jmx
```
View
@@ -1,6 +1,5 @@
server {
- port = 8080
- sslPort = 8181
+ port = 9000
}
services {
scamperService {
View
@@ -14,3 +14,11 @@ libraryDependencies ++= Seq(
"ch.qos.logback" % "logback-classic" % "1.0.0" % "runtime"
)
+seq(webSettings :_*)
+
+classpathTypes ~= (_ + "orbit")
+
+libraryDependencies ++= Seq(
+ "org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "compile,container" artifacts (Artifact("javax.servlet", "jar", "jar"))
+ , "org.eclipse.jetty" % "jetty-webapp" % "8.1.4.v20120524" % "compile,container" artifacts (Artifact("jetty-webapp", "jar", "jar"))
+)
View
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<jmeterTestPlan version="1.2" properties="2.3">
- <hashTree>
- <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
- <stringProp name="TestPlan.comments"></stringProp>
- <boolProp name="TestPlan.functional_mode">false</boolProp>
- <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
- <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
- <collectionProp name="Arguments.arguments"/>
- </elementProp>
- <stringProp name="TestPlan.user_define_classpath"></stringProp>
- </TestPlan>
- <hashTree>
- <Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
- <collectionProp name="Arguments.arguments">
- <elementProp name="loops" elementType="Argument">
- <stringProp name="Argument.name">loops</stringProp>
- <stringProp name="Argument.value">10</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- </elementProp>
- <elementProp name="host" elementType="Argument">
- <stringProp name="Argument.name">host</stringProp>
- <stringProp name="Argument.value">localhost</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- </elementProp>
- <elementProp name="port" elementType="Argument">
- <stringProp name="Argument.name">port</stringProp>
- <stringProp name="Argument.value">8080</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- </elementProp>
- <elementProp name="fastEndpoint" elementType="Argument">
- <stringProp name="Argument.name">fastEndpoint</stringProp>
- <stringProp name="Argument.value">/fast</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- </elementProp>
- <elementProp name="mediumEndpoint" elementType="Argument">
- <stringProp name="Argument.name">mediumEndpoint</stringProp>
- <stringProp name="Argument.value">/medium</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- </elementProp>
- <elementProp name="slowEndpoint" elementType="Argument">
- <stringProp name="Argument.name">slowEndpoint</stringProp>
- <stringProp name="Argument.value">/slow</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- </elementProp>
- <elementProp name="fastThreads" elementType="Argument">
- <stringProp name="Argument.name">fastThreads</stringProp>
- <stringProp name="Argument.value">100</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- </elementProp>
- <elementProp name="mediumThreads" elementType="Argument">
- <stringProp name="Argument.name">mediumThreads</stringProp>
- <stringProp name="Argument.value">75</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- </elementProp>
- <elementProp name="slowThreads" elementType="Argument">
- <stringProp name="Argument.name">slowThreads</stringProp>
- <stringProp name="Argument.value">25</stringProp>
- <stringProp name="Argument.metadata">=</stringProp>
- </elementProp>
- </collectionProp>
- </Arguments>
- <hashTree/>
- <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
- <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
- <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
- <boolProp name="LoopController.continue_forever">false</boolProp>
- <stringProp name="LoopController.loops">${loops}</stringProp>
- </elementProp>
- <stringProp name="ThreadGroup.num_threads">${fastThreads}</stringProp>
- <stringProp name="ThreadGroup.ramp_time">1</stringProp>
- <longProp name="ThreadGroup.start_time">1347296476000</longProp>
- <longProp name="ThreadGroup.end_time">1347296476000</longProp>
- <boolProp name="ThreadGroup.scheduler">false</boolProp>
- <stringProp name="ThreadGroup.duration"></stringProp>
- <stringProp name="ThreadGroup.delay"></stringProp>
- </ThreadGroup>
- <hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="${host}:${port}${fastEndpoint}" enabled="true">
- <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
- <collectionProp name="Arguments.arguments"/>
- </elementProp>
- <stringProp name="HTTPSampler.domain">${host}</stringProp>
- <stringProp name="HTTPSampler.port">${port}</stringProp>
- <stringProp name="HTTPSampler.connect_timeout"></stringProp>
- <stringProp name="HTTPSampler.response_timeout"></stringProp>
- <stringProp name="HTTPSampler.protocol"></stringProp>
- <stringProp name="HTTPSampler.contentEncoding"></stringProp>
- <stringProp name="HTTPSampler.path">${fastEndpoint}</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
- <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
- <boolProp name="HTTPSampler.monitor">false</boolProp>
- <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
- <stringProp name="TestPlan.comments"> </stringProp>
- </HTTPSamplerProxy>
- <hashTree/>
- <Summariser guiclass="SummariserGui" testclass="Summariser" testname="${host}:${port}${fastEndpoint} " enabled="true"/>
- <hashTree/>
- </hashTree>
- <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
- <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
- <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
- <boolProp name="LoopController.continue_forever">false</boolProp>
- <stringProp name="LoopController.loops">${loops}</stringProp>
- </elementProp>
- <stringProp name="ThreadGroup.num_threads">${mediumThreads}</stringProp>
- <stringProp name="ThreadGroup.ramp_time">1</stringProp>
- <longProp name="ThreadGroup.start_time">1347296476000</longProp>
- <longProp name="ThreadGroup.end_time">1347296476000</longProp>
- <boolProp name="ThreadGroup.scheduler">false</boolProp>
- <stringProp name="ThreadGroup.duration"></stringProp>
- <stringProp name="ThreadGroup.delay"></stringProp>
- </ThreadGroup>
- <hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="${host}:${port}${mediumEndpoint}" enabled="true">
- <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
- <collectionProp name="Arguments.arguments"/>
- </elementProp>
- <stringProp name="HTTPSampler.domain">${host}</stringProp>
- <stringProp name="HTTPSampler.port">${port}</stringProp>
- <stringProp name="HTTPSampler.connect_timeout"></stringProp>
- <stringProp name="HTTPSampler.response_timeout"></stringProp>
- <stringProp name="HTTPSampler.protocol"></stringProp>
- <stringProp name="HTTPSampler.contentEncoding"></stringProp>
- <stringProp name="HTTPSampler.path">${mediumEndpoint}</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
- <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
- <boolProp name="HTTPSampler.monitor">false</boolProp>
- <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
- <stringProp name="TestPlan.comments"> </stringProp>
- </HTTPSamplerProxy>
- <hashTree/>
- <Summariser guiclass="SummariserGui" testclass="Summariser" testname="${host}:${port}${mediumEndpoint}" enabled="true"/>
- <hashTree/>
- </hashTree>
- <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
- <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
- <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
- <boolProp name="LoopController.continue_forever">false</boolProp>
- <stringProp name="LoopController.loops">${loops}</stringProp>
- </elementProp>
- <stringProp name="ThreadGroup.num_threads">${slowThreads}</stringProp>
- <stringProp name="ThreadGroup.ramp_time">1</stringProp>
- <longProp name="ThreadGroup.start_time">1347296476000</longProp>
- <longProp name="ThreadGroup.end_time">1347296476000</longProp>
- <boolProp name="ThreadGroup.scheduler">false</boolProp>
- <stringProp name="ThreadGroup.duration"></stringProp>
- <stringProp name="ThreadGroup.delay"></stringProp>
- </ThreadGroup>
- <hashTree>
- <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="${host}:${port}${slowEndpoint}" enabled="true">
- <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
- <collectionProp name="Arguments.arguments"/>
- </elementProp>
- <stringProp name="HTTPSampler.domain">${host}</stringProp>
- <stringProp name="HTTPSampler.port">${port}</stringProp>
- <stringProp name="HTTPSampler.connect_timeout"></stringProp>
- <stringProp name="HTTPSampler.response_timeout"></stringProp>
- <stringProp name="HTTPSampler.protocol"></stringProp>
- <stringProp name="HTTPSampler.contentEncoding"></stringProp>
- <stringProp name="HTTPSampler.path">${slowEndpoint}</stringProp>
- <stringProp name="HTTPSampler.method">GET</stringProp>
- <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
- <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
- <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
- <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
- <boolProp name="HTTPSampler.monitor">false</boolProp>
- <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
- <stringProp name="TestPlan.comments"> </stringProp>
- </HTTPSamplerProxy>
- <hashTree/>
- <Summariser guiclass="SummariserGui" testclass="Summariser" testname="${host}:${port}${slowEndpoint} " enabled="true"/>
- <hashTree/>
- </hashTree>
- </hashTree>
- </hashTree>
-</jmeterTestPlan>
@@ -0,0 +1,2 @@
+libraryDependencies += "com.github.siasia" %% "xsbt-web-plugin" % "0.12.0-0.2.11.1"
+
@@ -1,18 +1,25 @@
package scamper
+import org.eclipse.jetty.server.nio.SelectChannelConnector
+import org.eclipse.jetty.server.Server
+import org.eclipse.jetty.util.thread.QueuedThreadPool
+import org.eclipse.jetty.webapp.WebAppContext
import akka.dispatch.Future
-
+import blueeyes.core.data.ByteChunk
+import blueeyes.core.data.BijectionsChunkString
+import blueeyes.core.http.HttpRequest
+import blueeyes.core.http.HttpResponse
+import blueeyes.BlueEyesServer
import blueeyes.BlueEyesServiceBuilder
-import blueeyes.core.http.{HttpRequest, HttpResponse, HttpStatus}
-import blueeyes.core.http.HttpStatusCodes._
-import blueeyes.core.data.{ByteChunk, BijectionsChunkString}
+import blueeyes.ServletServer
+import blueeyes.core.service.engines.servlet.ServletEngine
-import blueeyes.BlueEyesServer
+object NettyScamperServer extends BlueEyesServer with ScamperService
-object ScamperServer extends BlueEyesServer with ScamperService
+class ScamperServlet extends ServletServer with ServletEngine with ScamperService
trait ScamperService extends BlueEyesServiceBuilder with BijectionsChunkString {
-
+
def sleep(ms: Long): Long = {
val start = System.currentTimeMillis
Thread.sleep(ms)
@@ -25,30 +32,48 @@ trait ScamperService extends BlueEyesServiceBuilder with BijectionsChunkString {
startup {
Future { () }
} ->
- request { config: Unit =>
- path("/fast") {
- (request: HttpRequest[ByteChunk]) =>
+ request { config: Unit =>
+ path("/fast") {
+ (request: HttpRequest[ByteChunk]) =>
Future {
HttpResponse[ByteChunk](content = Some("<h1>slept for %d ms</h1>".format(sleep(0))))
}
- } ~
- path("/medium") {
- (request: HttpRequest[ByteChunk]) =>
- Future {
- HttpResponse[ByteChunk](content = Some("<h1>slept for %d ms</h1>".format(sleep(150))))
- }
- } ~
- path("/slow") {
- (request: HttpRequest[ByteChunk]) =>
- Future {
- HttpResponse[ByteChunk](content = Some("<h1>slept for %d ms</h1>".format(sleep(300))))
- }
+ } ~
+ path("/medium") {
+ (request: HttpRequest[ByteChunk]) =>
+ Future {
+ HttpResponse[ByteChunk](content = Some("<h1>slept for %d ms</h1>".format(sleep(150))))
+ }
+ } ~
+ path("/slow") {
+ (request: HttpRequest[ByteChunk]) =>
+ Future {
+ HttpResponse[ByteChunk](content = Some("<h1>slept for %d ms</h1>".format(sleep(300))))
+ }
+ }
+ } ->
+ shutdown { config =>
+ println("Shutting down")
+ Future { () }
}
- } ->
- shutdown { config =>
- println("Shutting down")
- Future { () }
- }
}
}
+object JettyScamperServer extends App {
+
+ val server = new Server()
+
+ val connector = new SelectChannelConnector()
+ connector.setPort(9000)
+ connector.setThreadPool(new QueuedThreadPool(24))
+
+ server.addConnector(connector)
+
+ val webapp = new WebAppContext()
+ webapp.setContextPath("/")
+ webapp.setWar("src/main/webapp")
+ server.setHandler(webapp)
+
+ server.start()
+ server.join()
+}
Oops, something went wrong.

0 comments on commit 1c7f9f1

Please sign in to comment.