org.logicalcobwebs.proxool
Class PerformanceTest

java.lang.Object
  extended by TestCase
      extended by org.logicalcobwebs.proxool.AbstractProxoolTest
          extended by org.logicalcobwebs.proxool.PerformanceTest
All Implemented Interfaces:
StatisticsListenerIF

public class PerformanceTest
extends AbstractProxoolTest
implements StatisticsListenerIF

Tests how fast Proxool is compared to the "perfect" pool, SimpoolAdapter.

Since:
Proxool 0.5
Version:
$Revision: 1.17 $, $Date: 2003/11/04 13:54:02 $
Author:
Bill Horsman (bill@logicalcobwebs.co.uk), $Author: billhorsman $ (current maintainer)

Nested Class Summary
(package private)  class PerformanceTest.AnnoyingConnector
           
(package private)  class PerformanceTest.DisagreeableSnapshotter
           
 
Field Summary
private static int COUNT
           
private static Log LOG
           
private static java.text.DecimalFormat millisecondsFormat
           
private static int PERIOD
           
private  long servedCount
           
private  StatisticsIF statistics
           
private  java.lang.Thread waitingThead
           
 
Constructor Summary
PerformanceTest(java.lang.String s)
           
 
Method Summary
private  void doWait()
           
 void statistics(java.lang.String alias, StatisticsIF statistics)
          A new set of statistics have just been produced
 void testPerformance()
          Test how many connections we can serve if we go as fast as we can!
 void testSnapshotImpact()
           
 
Methods inherited from class org.logicalcobwebs.proxool.AbstractProxoolTest
setUp, tearDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Log LOG

millisecondsFormat

private static java.text.DecimalFormat millisecondsFormat

waitingThead

private java.lang.Thread waitingThead

statistics

private StatisticsIF statistics

PERIOD

private static final int PERIOD
See Also:
Constant Field Values

COUNT

private static final int COUNT
See Also:
Constant Field Values

servedCount

private long servedCount
Constructor Detail

PerformanceTest

public PerformanceTest(java.lang.String s)
Method Detail

testPerformance

public void testPerformance()
                     throws ProxoolException,
                            java.lang.InterruptedException
Test how many connections we can serve if we go as fast as we can!

Throws:
ProxoolException - if anything goes wrong
java.lang.InterruptedException

doWait

private void doWait()

statistics

public void statistics(java.lang.String alias,
                       StatisticsIF statistics)
Description copied from interface: StatisticsListenerIF
A new set of statistics have just been produced

Specified by:
statistics in interface StatisticsListenerIF
Parameters:
alias - identifies the pool
statistics - new statistics

testSnapshotImpact

public void testSnapshotImpact()
                        throws ProxoolException
Throws:
ProxoolException