diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java index b4f1b1a850e..6690e312b3e 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/StressTest.java @@ -220,141 +220,154 @@ public class StressTest extends TestCase throw e; } } - + public void doThreads(int threads,final int loops,final boolean persistent) throws Throwable { final Throwable[] throwable=new Throwable[threads]; final Thread[] thread=new Thread[threads]; - for (int i=0;imax) + max=l; + total+=l; + if (l==loops) + finished++; + } + } + String status = "min/ave/max/target="+min+"/"+(total/threads)+"/"+max+"/"+loops+" errors/finished/loops="+errors+"/"+finished+"/"+threads+" idle/threads="+(_threads.getIdleThreads())+"/"+_threads.getThreads(); + if (status.equals(last)) + { + if (same++>10) + throw new IllegalStateException("Stalled"); } else - { - if (lmax) - max=l; - total+=l; - if (l==loops) - finished++; - } + same=0; + last=status; + Log.info(status); + if ((finished+errors)==threads) + break; } - String status = "min/ave/max/target="+min+"/"+(total/threads)+"/"+max+"/"+loops+" errors/finished/loops="+errors+"/"+finished+"/"+threads+" idle/threads="+(_threads.getIdleThreads())+"/"+_threads.getThreads(); - if (status.equals(last)) - { - if (same++>10) - throw new IllegalStateException("Stalled"); - } - else - same=0; - last=status; - Log.info(status); - if ((finished+errors)==threads) - break; - } - - for (int i=0;i latencies=_latencies[i]; - length[i] = latencies.size(); - loop: - for (long latency:(Queue)(_latencies[i])) - { - for (int q=0;q=(q*100) && latency<((q+1)*100)) - { - count[i][q]++; - continue loop; - } - } - System.err.println("other latency "+latency); - other[i]++; - } - } + for (int i=0;i latencies=_latencies[i]; + length[i] = latencies.size(); + + loop: + for (long latency:(Queue)(_latencies[i])) + { + for (int q=0;q=(q*100) && latency<((q+1)*100)) + { + count[i][q]++; + continue loop; + } + } + other[i]++; + } + } + + System.out.println(" stage:\tbind\twrite\trecv\tdispatch\twrote\ttotal"); + for (int q=0;q