반응형

부하테스트 툴을 사용할 기회가 생겼는데. jmeter 가 가장 많이 언급된다.

 

[관련사이트]

1. 영문 : http://jmeter.apache.org/usermanual/component_reference.html

--> jmeter 자체 메뉴얼이다.

 

2. 한글 : http://blog.naver.com/orion_203?Redirect=Log&logNo=130114210433

--> 웹애플리케이션의 성능테스트시에 숙지해야할 주요 차이점을 알려준다.

--> req/conn

 

3. 한빛

--> 상세 설명을 제공한다.

http://www.hanb.co.kr/network/view.html?bi_id=1520

http://www.hanb.co.kr/network/view.html?bi_id=1521

http://www.hanb.co.kr/network/view.html?bi_id=1522

 

 

[검토 내용]

초간단 정의 (Elements of a Test Plan)

- Thread Group : 최상위 요소

- Controller : 서버에 테스트 요청을 전달 할 때 무엇을 언제 보낼지를 설정

- Samplers : 테스트 목적에 맞는 요청을 설정(HTTP 요청, FTP 요청)

- Logic Controllers : 언제 요청을 전달해야 하는지 결정

 

 

 

[참고]

- 다른 테스트 도구 : http://linux.die.net/man/1/httperf

                            , http://www.xenoclast.org/autobench/

 

 

[Java Test]

- Java 테스트를 사용하기로 한다.

- JavaSamplerClient 인터페이스를 구현해야 한다.

 

 

18.1.4 Java Request
This sampler lets you control a java class that implements the org.apache.jmeter.protocol.java.sampler.JavaSamplerClient interface. By writing your own implementation of this interface, you can use JMeter to harness multiple threads, input parameter control, and data collection.
The pull-down menu provides the list of all such implementations found by JMeter in its classpath. The parameters can then be specified in the table below - as defined by your implementation. Two simple examples (JavaTest and SleepTest) are provided.
The JavaTest example sampler can be useful for checking test plans, because it allows one to set values in almost all the fields. These can then be used by Assertions, etc. The fields allow variables to be used, so the values of these can readily be seen.
Control Panel




The Add/Delete buttons don't serve any purpose at present.
Parameters
 

 

 

The sleep time is calculated as follows:

SleepTime is in milliseconds
SleepMask is used to add a "random" element to the time:
totalSleepTime = SleepTime + (System.currentTimeMillis() % SleepMask)

 

인터페이스에 대한 설명

 

public interface JavaSamplerClient

 

This interface defines the interactions between the JavaSampler and external Java programs which can be executed by JMeter. Any Java class which wants to be executed as a JMeter test must implement this interface (either directly or indirectly through AbstractJavaSamplerClient).

JMeter will create one instance of a JavaSamplerClient implementation for each user/thread in the test. Additional instances may be created for internal use by JMeter (for example, to find out what parameters are supported by the client).

When the test is started, setupTest() will be called on each thread's JavaSamplerClient instance to initialize the client. Then runTest() will be called for each iteration of the test. Finally, teardownTest() will be called to allow the client to do any necessary clean-up.

The JMeter JavaSampler GUI allows a list of parameters to be defined for the test. These are passed to the various test methods through the JavaSamplerContext. A list of default parameters can be defined through the getDefaultParameters() method. These parameters and any default values associated with them will be shown in the GUI. Users can add other parameters as well.

When possible, Java tests should extend AbstractJavaSamplerClient rather than implementing JavaSamplerClient directly. This should protect your tests from future changes to the interface. While it may be necessary to make changes to the JavaSamplerClient interface from time to time (therefore requiring changes to any implementations of this interface), we intend to make this abstract class provide reasonable default implementations of any new methods so that subclasses do not necessarily need to be updated for new versions. Implementing JavaSamplerClient directly will continue to be supported for cases where extending this class is not possible (for example, when the client class is already a subclass of some other class).

See SleepTest for an example of how to implement this interface.

Version:

$Revision: 674365 $

반응형

+ Recent posts