Permalink
Browse files

Winstone (Java) PONG

  • Loading branch information...
1 parent b74de08 commit fa383c16b42422f7bf33b4a6cc726281f951e918 @snoyberg snoyberg committed Mar 15, 2011
View
@@ -0,0 +1,18 @@
+package test;
+
+import java.io.*;
+
+import javax.servlet.http.*;
+import javax.servlet.*;
+
+public class Pong extends HttpServlet {
+ public void doGet (HttpServletRequest req,
+ HttpServletResponse res)
+ throws ServletException, IOException
+ {
+ PrintWriter out = res.getWriter();
+
+ out.println("PONG");
+ out.close();
+ }
+}
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>pong</servlet-name>
+ <servlet-class>test.Pong</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>pong</servlet-name>
+ <url-pattern>/pong</url-pattern>
+ </servlet-mapping>
+
+</web-app>
View
@@ -0,0 +1 @@
+rm -f ../../pong.war WEB-INF/lib/pong.jar && javac Pong.java -cp ../../winstone-0.9.10.jar && mkdir -p test && cp Pong.class test && mkdir -p WEB-INF/lib && jar cfv WEB-INF/lib/pong.jar test && jar cfv pong.war WEB-INF/ && mv pong.war ../..
View
Binary file not shown.
View
Binary file not shown.
View
@@ -0,0 +1,12 @@
+#!/bin/bash -x
+
+d=$(readlink -f $(dirname $0))
+
+java -jar winstone-0.9.10.jar --warfile pong.war --httpPort=3000 &
+ja=$!
+
+sleep 1
+
+httperf --hog --server=localhost --port=3000 --uri=/ --rate=1000 --num-conns=200 --num-calls=100 --burst-length=20 > results/winstone
+
+kill $ja

0 comments on commit fa383c1

Please sign in to comment.