directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r422220 - /directory/branches/apacheds/optimization/benchmarks/src/main/java/org/apache/directory/server/benchmarks/BindBenchmark.java
Date Sat, 15 Jul 2006 14:01:09 GMT
Author: akarasulu
Date: Sat Jul 15 07:01:08 2006
New Revision: 422220

URL: http://svn.apache.org/viewvc?rev=422220&view=rev
Log:
Adding first SLAMD stress test case.

Added:
    directory/branches/apacheds/optimization/benchmarks/src/main/java/org/apache/directory/server/benchmarks/BindBenchmark.java

Added: directory/branches/apacheds/optimization/benchmarks/src/main/java/org/apache/directory/server/benchmarks/BindBenchmark.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/benchmarks/src/main/java/org/apache/directory/server/benchmarks/BindBenchmark.java?rev=422220&view=auto
==============================================================================
--- directory/branches/apacheds/optimization/benchmarks/src/main/java/org/apache/directory/server/benchmarks/BindBenchmark.java
(added)
+++ directory/branches/apacheds/optimization/benchmarks/src/main/java/org/apache/directory/server/benchmarks/BindBenchmark.java
Sat Jul 15 07:01:08 2006
@@ -0,0 +1,80 @@
+package org.apache.directory.server.benchmarks;
+
+
+import com.sun.slamd.job.JobClass;
+import com.sun.slamd.job.UnableToRunException;
+import com.sun.slamd.parameter.BooleanParameter;
+import com.sun.slamd.parameter.ParameterList;
+import com.sun.slamd.stat.IncrementalTracker;
+import com.sun.slamd.stat.StatTracker;
+
+
+public class BindBenchmark extends JobClass
+{
+    IncrementalTracker incremental = null;
+    
+    
+    public String getJobDescription()
+    {
+        return "Does a bind using a single user name then unbinds.";
+    }
+
+    
+    public String getJobName()
+    {
+        return "Simple Bind";
+    }
+    
+    
+    public String getJobCategoryName()
+    {
+        return "ApacheDS";
+    }
+
+    
+    public ParameterList getParameterStubs()
+    {
+        ParameterList list = new ParameterList();
+        list.addParameter( new BooleanParameter( "TestParam", "Test Parameter", "just for
testing", true ) );
+        return list;
+    }
+
+
+    public StatTracker[] getStatTrackerStubs( String clientId, String threadId, int interval
)
+    {
+        return new StatTracker[] { new IncrementalTracker( clientId, threadId, "test tracker",
interval ) };
+    }
+
+    
+    public StatTracker[] getStatTrackers()
+    {
+        return new StatTracker[] { incremental };
+    }
+
+    
+    public void initializeThread( String clientId, String threadId, int interval, ParameterList
params ) 
+        throws UnableToRunException
+    {
+        super.logMessage( "initializeThread() called" );
+        incremental = new IncrementalTracker( clientId, threadId, "test tracker", interval
);
+    }
+
+
+    public void runJob()
+    {
+        incremental.startTracker();
+        while ( !shouldStop() )
+        {
+            try
+            {
+                Thread.sleep( 200 );
+                incremental.increment();
+            }
+            catch ( InterruptedException e )
+            {
+                e.printStackTrace();
+            }
+        }
+        incremental.stopTracker();
+    }
+}



Mime
View raw message