Permalink
Browse files

gh

  • Loading branch information...
0 parents commit 34204b71233cfc638ac222128c151bc7791d8bc2 @softprops committed Nov 8, 2010
@@ -0,0 +1,6 @@
+project/plugins/project/build.properties
+target
+project/boot
+lib_managed
+.DS_Store
+src_managed
@@ -0,0 +1,41 @@
+# unfiltered bench
+
+some scripts and sample servers for benchmarking unfiltered servers
+
+# setup
+
+update deps
+
+ sbt update
+
+install tooling
+
+via [homebrew](https://github.com/mxcl/homebrew)
+
+ sudo brew install -v gnuplot
+
+# usage
+
+run netty server on port 8080
+
+ sbt "run netty"
+
+run ab test on netty
+
+ ab -n 8000 -c 100 -g netty.dat http://127.0.0.1:8080/
+
+shutdown netty
+
+run jetty server on port 8080
+
+ sbt "run jetty"
+
+run ab test on jetty
+
+ ab -n 8000 -c 100 -g jetty.dat http://127.0.0.1:8080/
+
+generate the ab graph `out.png`
+
+ gnuplot ./scripts/ab_plot.p
+
+2010 Doug Tangren (softprops)
@@ -0,0 +1,8 @@
+#Project properties
+#Sat Nov 06 22:29:38 EDT 2010
+project.organization=me.lessis
+project.name=Unfiltered Bench
+sbt.version=0.7.4
+project.version=0.0.1
+build.scala.versions=2.8.0
+project.initialize=false
@@ -0,0 +1,14 @@
+import sbt._
+class Project(info: ProjectInfo) extends DefaultProject(info) {
+ val uf_version = "0.2.2"
+ // jetty
+ val uff = "net.databinder" %% "unfiltered-filter" % uf_version
+ val ufj = "net.databinder" %% "unfiltered-jetty" % uf_version
+
+ // netty
+ val ufn = "net.databinder" %% "unfiltered-netty" % uf_version
+
+ // netty dependencies
+ lazy val jboss = "JBoss repository" at
+ "http://repository.jboss.org/maven2"
+}
@@ -0,0 +1,19 @@
+# output format
+set terminal png
+
+set output "out.png"
+
+# graph title
+set title "ab -n 8000 -c 100"
+
+# nicer aspect ratio for image size
+set size 1,0.7
+
+# y-axis grid
+set grid y
+
+set xlabel "request"
+
+set ylabel "response time (ms)"
+
+plot "jetty.dat" using 9 smooth sbezier with lines title "unfiltered jetty", "netty.dat" using 9 smooth sbezier with lines title "unfiltered netty"
@@ -0,0 +1,8 @@
+object Main {
+ def main(args: Array[String]) {
+ (args match {
+ case Array("netty") => netty.App.server
+ case Array("jetty") => jetty.App.server
+ }).run
+ }
+}
@@ -0,0 +1,12 @@
+package jetty
+
+import unfiltered.request._
+import unfiltered.response._
+
+import unfiltered.filter._
+
+object App {
+ lazy val server = unfiltered.jetty.Http(8080).filter(unfiltered.filter.Planify{
+ case _ => ResponseString("Hello Netty")
+ })
+}
@@ -0,0 +1,13 @@
+package netty
+
+import unfiltered.request._
+import unfiltered.response._
+
+import unfiltered.filter._
+
+object App {
+ // unfiltered.netty.cycle.Plan
+ var server = unfiltered.netty.Http(8080).handler(unfiltered.netty.cycle.Planify {
+ case _ => ResponseString("Hello Netty")
+ })
+}
@@ -0,0 +1,19 @@
+# output format
+set terminal canvas
+
+set output "out.html"
+
+# graph title
+set title "ab -n 8000 -c 100"
+
+# nicer aspect ratio for image size
+set size 1,0.7
+
+# y-axis grid
+set grid y
+
+set xlabel "request"
+
+set ylabel "response time (ms)"
+
+plot "jetty.dat" using 9 smooth sbezier with lines title "unfiltered jetty", "netty.dat" using 9 smooth sbezier with lines title "unfiltered netty"

0 comments on commit 34204b7

Please sign in to comment.