문서의 이전 판입니다!
public class UserSerializerTest { @Rule public ContiPerfRule i = new ContiPerfRule(); @Test @PerfTest(invocations = 200, threads = 2) // 2개 쓰레드에서 200번(각 100번)호출 @Required(max = 1200, average = 250) // 테스트 통과조건 public void shouldSerializeRandomUser() throws JAXBException { // ... } }
invocations
: 테스트의 총 호출 횟수threads
: 쓰레드 갯수rampup
: 최초에는 1개 쓰레드로 시작해 rampup 시간(ms)가 지날 때 마다 쓰레드 한개씩 증가시켜 최종 threads
갯수까지 증가시킨다.duration
: 전체 쓰레드갯수가 꽉찬 상태로 테스트를 진행할 시간(ms). invocations
과 함께 안사용하는것이 맞을 듯.warmup
: 지정된 시간(ms)가 지난 후 부터 성능 측정을 하라는 의미. 보통은 rampup
시간이 다지나 쓰레드가 꽉차는 시간((rampup -1) * threads
)을 지정한다. 그러면 rampup 시간을 제외한 Full Thread로 작동한 시간에 대해서만 측정한다.contiperf.active=false
지정.mvn test -DargLine="-Dcontiperf.active=false"
First the @Before method is called. Then the test method is invoked 1,000 times subsequently and finally the @After method(s). ContiPerf 2 supports this behaviour for all JUnit 4 versions since version 4.7.
@Before
메소드 호출@Test
메소드 지정된 횟수대로 호출@After
메소드 호출