directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r415082 - in /directory/sandbox/akarasulu/mina-profiling/server: server.sh src/main/java/org/apache/mina/performance/test/server/TestServer.java
Date Sun, 18 Jun 2006 01:35:49 GMT
Author: akarasulu
Date: Sat Jun 17 18:35:48 2006
New Revision: 415082

URL: http://svn.apache.org/viewvc?rev=415082&view=rev
Log:
adding ability to profile the server using yourkit and ability to est the server port using
a single argument

Modified:
    directory/sandbox/akarasulu/mina-profiling/server/server.sh
    directory/sandbox/akarasulu/mina-profiling/server/src/main/java/org/apache/mina/performance/test/server/TestServer.java

Modified: directory/sandbox/akarasulu/mina-profiling/server/server.sh
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/mina-profiling/server/server.sh?rev=415082&r1=415081&r2=415082&view=diff
==============================================================================
--- directory/sandbox/akarasulu/mina-profiling/server/server.sh (original)
+++ directory/sandbox/akarasulu/mina-profiling/server/server.sh Sat Jun 17 18:35:48 2006
@@ -6,4 +6,9 @@
   mvn clean assembly:assembly
 fi
 
-java -Dlog4j.configuration=file://$(pwd)/log4j.properties -jar target/server-1.0-SNAPSHOT-app.jar
$@
+if [ $1 == "profile" ]; then
+  java -agentlib:yjpagent -Dlog4j.configuration=file://$(pwd)/log4j.properties -jar target/server-1.0-SNAPSHOT-app.jar
$@
+else
+  java -Dlog4j.configuration=file://$(pwd)/log4j.properties -jar target/server-1.0-SNAPSHOT-app.jar
$@
+fi
+

Modified: directory/sandbox/akarasulu/mina-profiling/server/src/main/java/org/apache/mina/performance/test/server/TestServer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/akarasulu/mina-profiling/server/src/main/java/org/apache/mina/performance/test/server/TestServer.java?rev=415082&r1=415081&r2=415082&view=diff
==============================================================================
--- directory/sandbox/akarasulu/mina-profiling/server/src/main/java/org/apache/mina/performance/test/server/TestServer.java
(original)
+++ directory/sandbox/akarasulu/mina-profiling/server/src/main/java/org/apache/mina/performance/test/server/TestServer.java
Sat Jun 17 18:35:48 2006
@@ -9,9 +9,18 @@
 
 public class TestServer
 {
+    public static final int DEFAULT_PORT = 10389;
+
+
     public static final void main( String[] args ) throws Exception
     {
+        int port = DEFAULT_PORT;
+        if ( args.length > 0 )
+        {
+            port = Integer.parseInt( args[0] );
+        }
+
         IoAcceptor acceptor = new SocketAcceptor( 2 );
-        acceptor.bind( new InetSocketAddress( 10389 ), new TestServerHandler() );
+        acceptor.bind( new InetSocketAddress( port ), new TestServerHandler() );
     }
 }



Mime
View raw message