nGrinder

jdk-22 ์ตœ์‹ ์„ค์น˜ x
11์„ ๋ฐ›์•„์•ผํ•œ๋‹ค
  • ๋ผ์ด์„ผ์Šค ๋•Œ๋ฌธ์— ๋กœ๊ทธ์ธ์„ ํ•ด์•ผํ•œ๋‹ค

nGrinder ์ž์„ธํ•œ ์„ค๋ช… ๋ฐ ๊ตฌ์„ฑ ์ดํ•ดํ•˜๊ธฐ

1. nGrinder๋ž€ ๋ฌด์—‡์ธ๊ฐ€?

nGrinder๋Š” NHN์ด ๊ฐœ๋ฐœํ•œ ์˜คํ”ˆ์†Œ์Šค ๋ถ€ํ•˜ ํ…Œ์ŠคํŠธ ํ”Œ๋žซํผ์œผ๋กœ, ๊ธฐ์กด์— ์กด์žฌํ•˜๋Š” The Grinder๋ฅผ ํ™•์žฅํ•˜์—ฌ ๋Œ€๊ทœ๋ชจ ๋ถ€ํ•˜ ํ…Œ์ŠคํŠธ ๋ฐ ๋ถ„์‚ฐ ๋ถ€ํ•˜ ํ…Œ์ŠคํŠธ๊ฐ€ ๊ฐ€๋Šฅ. ์›น ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ํ†ตํ•ด ๋ถ€ํ•˜ ํ…Œ์ŠคํŠธ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ƒ์„ฑ, ๊ด€๋ฆฌํ•˜๋ฉฐ ๋‹ค์ˆ˜์˜ ์—์ด์ „ํŠธ ์„œ๋ฒ„๋ฅผ ํ†ตํ•ด ๋ถ„์‚ฐ ๋ถ€ํ•˜ ํ…Œ์ŠคํŠธ๋ฅผ ์ˆ˜ํ–‰.

nGrinder์˜ ์ฃผ์š” ๊ธฐ๋Šฅ:

  • ๋‹ค์–‘ํ•œ ์Šคํฌ๋ฆฝํŠธ ์–ธ์–ด ์ง€์›: Jython, Groovy

  • ์‹ค์‹œ๊ฐ„ ๋ชจ๋‹ˆํ„ฐ๋ง ๋ฐ ๋ ˆํฌํŠธ

  • ๋™์  ์—์ด์ „ํŠธ ํ• ๋‹น์„ ํ†ตํ•œ ํ™•์žฅ์„ฑ

  • ์—์ด์ „ํŠธ ๋ณ‘๋ ฌ ๊ตฌ๋™ ๋ฐ ๋ถ„์‚ฐ ํ…Œ์ŠคํŠธ

2. ์—์ด์ „ํŠธ๋ฅผ ๋”ฐ๋กœ ๊ตฌ๋™ํ•ด์•ผ ํ•˜๋Š” ์ด์œ  ๋ฐ ๋™์ž‘ ์›๋ฆฌ

์—์ด์ „ํŠธ ๊ตฌ๋™ ํ•„์š” ์ด์œ :

  • ํ™•์žฅ์„ฑ: nGrinder Controller๋Š” ํ…Œ์ŠคํŠธ ๊ด€๋ฆฌ๋ฅผ ๋‹ด๋‹นํ•˜๋ฉฐ, ์‹ค์ œ๋กœ ๋ถ€ํ•˜๋ฅผ ๋ฐœ์ƒ์‹œํ‚ค๋Š” ๊ฒƒ์€ ์—์ด์ „ํŠธ.

  • ๋ถ„์‚ฐ ํ…Œ์ŠคํŠธ: ์—ฌ๋Ÿฌ ๋Œ€์˜ ์—์ด์ „ํŠธ๋ฅผ ํ†ตํ•ด ๋‹ค์ˆ˜์˜ ์„œ๋ฒ„์— ๋™์‹œ์— ์š”์ฒญ์„ ๋ณด๋‚ผ ์ˆ˜ ์žˆ์–ด ๋Œ€๊ทœ๋ชจ ๋ถ€ํ•˜ ํ…Œ์ŠคํŠธ์— ์ ํ•ฉ.

์—์ด์ „ํŠธ ๋™์ž‘ ๊ตฌ์กฐ:

  1. Controller์—์„œ ๋ช…๋ น ์ „์†ก: Controller์—์„œ ๋ถ€ํ•˜ ํ…Œ์ŠคํŠธ ์Šคํฌ๋ฆฝํŠธ์™€ ์„ค์ • ์ •๋ณด๋ฅผ ์—์ด์ „ํŠธ์— ์ „์†ก.

  2. ์—์ด์ „ํŠธ ์‹คํ–‰: ๊ฐ ์—์ด์ „ํŠธ๋Š” ์Šคํฌ๋ฆฝํŠธ๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ๋ถ€ํ•˜ ํ…Œ์ŠคํŠธ๋ฅผ ์ˆ˜ํ–‰.

  3. ํ…Œ์ŠคํŠธ ๊ฒฐ๊ณผ ์ˆ˜์ง‘: ํ…Œ์ŠคํŠธ ๊ฒฐ๊ณผ๋ฅผ Controller๋กœ ๋ณด๋‚ด๊ณ , Controller๋Š” ์‹ค์‹œ๊ฐ„ ๋ชจ๋‹ˆํ„ฐ๋ง ๋ฐ ๋ ˆํฌํŠธ ์ œ๊ณต.

3. ์Šคํฌ๋ฆฝํŠธ ๋™์ž‘ ๊ตฌ์กฐ

์Šคํฌ๋ฆฝํŠธ๋Š” ๊ฐ ์—์ด์ „ํŠธ์—์„œ ํ…Œ์ŠคํŠธํ•  ๋‚ด์šฉ์„ ์ •์˜ํ•˜๋ฉฐ, GTest ๋˜๋Š” JUnit ์Šคํƒ€์ผ๋กœ ์ž‘์„ฑ ๊ฐ€๋Šฅ.

// Groovy ์Šคํƒ€์ผ ์˜ˆ์‹œ
import static net.grinder.script.Grinder.grinder
import net.grinder.plugin.http.HTTPRequest
import net.grinder.plugin.http.HTTPResponse

public class TestRunner {
    HTTPRequest request = new HTTPRequest()

    @BeforeProcess
    public static void beforeProcess() {
        grinder.logger.info("Before Process.")
    }

    @BeforeThread
    public void beforeThread() {
        grinder.statistics.delayReports = true
        grinder.logger.info("Before Thread.")
    }

    @Before
    public void before() {
        grinder.logger.info("Before Test.")
    }

    @Test
    public void test() {
        HTTPResponse response = request.GET("http://example.com")

        if (response.statusCode == 200) {
            grinder.logger.info("Request successful.")
        } else {
            grinder.logger.warn("Request failed.")
        }

        assert response.statusCode == 200
    }
}

ํ…Œ์ŠคํŠธ ๊ณผ์ • ์„ค๋ช…

  1. ์Šคํฌ๋ฆฝํŠธ ์ž‘์„ฑ

    • ์›ํ•˜๋Š” ๋ถ€ํ•˜ ํ…Œ์ŠคํŠธ ๋Œ€์ƒ์— ๋”ฐ๋ผ GTest, JUnit ๋˜๋Š” Groovy๋กœ ์ž‘์„ฑ.

  2. ์Šคํฌ๋ฆฝํŠธ ์—…๋กœ๋“œ

    • nGrinder ์›น ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ํ†ตํ•ด ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์—…๋กœ๋“œํ•˜๊ณ  ํ…Œ์ŠคํŠธ๋ฅผ ๊ตฌ์„ฑ.

  3. ํ…Œ์ŠคํŠธ ์‹คํ–‰

    • ์—์ด์ „ํŠธ ์„ ํƒ ๋ฐ ์Šคํฌ๋ฆฝํŠธ ์„ค์ • ํ›„, ๋ถ€ํ•˜ ํ…Œ์ŠคํŠธ ์‹คํ–‰.

  4. ๊ฒฐ๊ณผ ํ™•์ธ ๋ฐ ๋ถ„์„

    • ์›น ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ํ†ตํ•ด ์‹ค์‹œ๊ฐ„ ๋ชจ๋‹ˆํ„ฐ๋ง ๋ฐ ํ…Œ์ŠคํŠธ ์™„๋ฃŒ ํ›„ ๋ ˆํฌํŠธ ๋ถ„์„.

์š”์•ฝ:

  • nGrinder๋Š” ๋Œ€๊ทœ๋ชจ ๋ถ€ํ•˜ ํ…Œ์ŠคํŠธ๋ฅผ ์œ„ํ•œ ์˜คํ”ˆ์†Œ์Šค ํ”Œ๋žซํผ์œผ๋กœ, ํ™•์žฅ์„ฑ๊ณผ ๋ถ„์‚ฐ ๋ถ€ํ•˜ ํ…Œ์ŠคํŠธ ๊ธฐ๋Šฅ์ด ์ฃผ์š” ํŠน์ง•.

  • Controller-์—์ด์ „ํŠธ ๊ตฌ์กฐ๋กœ ํ…Œ์ŠคํŠธ๋ฅผ ๊ด€๋ฆฌํ•˜๋ฉฐ, ์—์ด์ „ํŠธ๊ฐ€ ์‹ค์ œ ๋ถ€ํ•˜๋ฅผ ๋ฐœ์ƒ์‹œํ‚ด.

  • ์Šคํฌ๋ฆฝํŠธ ์ž‘์„ฑ ๋ฐ ์‹คํ–‰์„ ํ†ตํ•ด ์›น ์ธํ„ฐํŽ˜์ด์Šค๋กœ ์‹ค์‹œ๊ฐ„ ๋ชจ๋‹ˆํ„ฐ๋ง๊ณผ ๊ฒฐ๊ณผ ๋ถ„์„ ๊ฐ€๋Šฅ.

Q1: nGrinder์˜ ๊ฐ ์Šคํฌ๋ฆฝํŠธ ์œ ํ˜•๋ณ„ ์ž‘์„ฑ ๋ฐ ํ™œ์šฉ ์˜ˆ์‹œ๋ฅผ ๋ณด์—ฌ์ค„ ์ˆ˜ ์žˆ๋Š”๊ฐ€?

Q2: nGrinder๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ…Œ์ŠคํŠธ ์‹œ๋‚˜๋ฆฌ์˜ค๋ณ„ ํ…Œ์ŠคํŠธ ์ „๋žต์„ ์–ด๋–ป๊ฒŒ ์ˆ˜๋ฆฝํ•  ์ˆ˜ ์žˆ๋Š”๊ฐ€?

Q3: nGrinder์™€ JMeter์˜ ์ฐจ์ด์  ๋ฐ ์ ํ•ฉํ•œ ์‚ฌ์šฉ ์‚ฌ๋ก€๋Š” ๋ฌด์—‡์ธ๊ฐ€?

Last updated