1 24 25 package org.objectweb.cjdbc.scenario.users; 26 27 import org.objectweb.cjdbc.scenario.templates.Raidb1RecoveryWithRequestSenderTemplate; 28 import org.objectweb.cjdbc.scenario.tools.util.QueryGenerator; 29 30 36 public class JunailiScenario extends Raidb1RecoveryWithRequestSenderTemplate 37 { 38 public void testSpeedDecrease() throws Exception 39 { 40 41 sender.setMonitorSpeed(true); 42 sender.setRequestInterval(1); 43 sender.setUsePreparedStatement(false); 44 45 sender.setQuit(true); 47 t.join(); 48 sender.setQuit(false); 49 50 QueryGenerator generator = new QueryGenerator(getCJDBCConnection()); 52 generator.setSchemaUpdateRatio(0); 53 generator.setCreateDropRatio(1); 54 generator.setReadWriteRatio(0.5); 55 generator.setInsertUpdateRatio(0); 56 sender.setQueryGenerator(generator); 57 sender.setUseQueryGenerator(true); 58 t = new Thread (sender, "RequestSender"); 59 t.start(); 60 int count = 0; 61 while (count++ < 10000) 62 { 63 Thread.sleep(1000); 64 } 67 68 sender.setQuit(true); 69 System.out.println("Request Response Time Average( out of " 70 + sender.getRequestCount() + " requests):" + sender.getAverage() 71 + " ms"); 72 if (sender.getAverage() > 1000) 73 fail("Average response time too slow ..."); 74 } 75 } | Popular Tags |