Search code examples
javamultithreadingperformancejunitcontiperf

JUnit Perfomance testing (Contiperf)


I'm currently in the middle of some performance testing with a peer-to-peer service application I developed.

I have very little experience with performance testing. I can't find a decent guide and I am basically picking numbers at random. (i.e. the amount of threads to use)

Has anyone any advice on this issue? i.e how many threads etc.

I'm using contiperf by the way. Annotation based performance testing. Heres a sample test method.

@Rule
public ContiPerfRule i = new ContiPerfRule();

@Test
@PerfTest(duration = 5000, threads = 10)
@Required(throughput = 50000)
public void test12() throws InterruptedException, FileNotFoundException, CertificateException
{
  nodes.iterator().next().lookup(ee33.getSerialNumber().toString()+ee33.getPublicKey().toString());
}

Solution

  • Hopefully your choice of "random numbers" doesn't really matter. i.e. whether you pick 10 or 100 doesn't matter too much.

    I would start with a stress test first (test it until it breaks), and then create a load test based on that (test it in a range it should work)