record 문의..

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

record 문의..

helplz
통계관련해서 문의 드릴게 있습니다..

test1 = new GTest(1, "login")
test2 = new GTest(2, "ping")

req1 = new HTTPRequest()
req2 = new HTTPRequest()

test1.record(req1)
test2.record(req2)


test1.record(this, "test")
test2.record(this, "test")

@Test
public void test(){

      switch()
      {
         ...
      }
}

이런 식으로 작성 했는데요..

Login URL 에 request 를 해도 Ping 까지  성공 카운트가 다 올라가더라구요..
Login 을 보낼때는 Login 카운트만 올라가고,
Ping 보낼때는 Ping 카운트만 올가가게 하려면 어떻게 해야 할까요..

test() 함수를 test1() , test2()

로 하고

test1.record(this, "test1")
test2.record(this, "test2")

이렇게 불리해도 마찬가지더라구요..

그리고,,

test1.record(req1)
test1.record(this, "test")

이게 test1 은 httpRequest req1 와 "test" 함수에서 일어나는 일들을 기록한다..
라는 의미가 맞는건가요.. 설명을 따로 찾아볼수가 없어서요..

Reply | Threaded
Open this post in threaded view
|

Re: record 문의..

junoyoon
Administrator
문의를 잘 이해하기 힘들군요..
질문과 코드가 서로 달라서 ^^
Reply | Threaded
Open this post in threaded view
|

Re: record 문의..

helplz
제가 질문을 너무 어렵게 했군요 죄송합니다 ㅜㅠ

이미지를 첨부해서 다시 문의 드려 봅니다..



여기에서 성공 필드의 숫자는 어떤 것을 의미 하나요? 처음에 테스트명 login 만

10초 동안 보내는데 그림처럼 모든 테스트의 숫자가 다 올라가더라구요..

그리고 이 숫자가 올라갔다 또 내려가기도 하더라구요..

10초 동안 login 만 보내서 이게 login 만 숫자가 움직일거고 성공 필드에 대한 숫자가

request 성공한 숫자가 누적 된다고 생각 했었습니다..

그런데 제가 잘못 생각한 것인거 같아 보여서 정확히 어떤 의미인지 파악해보려고 문의 드렸습니다.

또한 위의 문의와 관련해서 제가 코드를 잘못 작성 한건지 해서

아래의 코드가 갖는 의미에 대해 문의 드린 것 입니다.

test = new GTest(1, "www.naver.com")
req  = new HTTPRequest()
test.record(req)
test.record(this, "test")

@Test
public void test(){
}

첫줄은 www.naver.com 이 테스트 명에 나타나고 있어서 용도가 파악이 됩니다.
궁금한 것이 3번째와 4번째 줄인데요

3번째 줄은 req 가 요청 되는 url 을 기록 하라
4번째 줄은 현재 스레드의 test 함수를 기록 하라

이런 의미인가요?

test = new GTest(1, "www.naver.com")
test2 = new GTest(2, "www.google.com")

req  = new HTTPRequest()
req2  = new HTTPRequest()
test.record(req)
test2.record(req2)

test.record(this, "test")
test2.record(this, "test")

이렇게 작성을 해도

test.record(this, "test")
test2.record(this, "test2")

이렇게 작성을 해도 성공 필드의 숫자는 모든 테스트가 동시에 다 변해서요..

혹시 이번 질문에도 이해가 안되시면 이해가 안되는 부분을 말씀해 주실 수 있을까요 ㅜㅠ
Reply | Threaded
Open this post in threaded view
|

Re: record 문의..

junoyoon
Administrator
test.record(req)
test.record(this, "test")

이 두개를 같이 쓰는 경우는 거의 없는 데요.
첫번째 라인은 req의 어떤 메소드들중 하나라고 성공적으로 실행되면 성공 카운트를 하나 올려라
두번째 라인은 현재 객체(즉 테스트 클래스)의 test() 메소드가 성공적으로 실행되면 성공 카운트를 하나 올려라 입니다.

test = new GTest(1, "www.naver.com")
test2 = new GTest(2, "www.google.com")

req  = new HTTPRequest()
req2  = new HTTPRequest()
test.record(req)
test2.record(req2)

test.record(this, "test")
test2.record(this, "test")

위 코드에서는 test() 메소드가 실행될 때 마다 1 번 테스트 2번 테스트에 성공 카운트가 둘다 올라갑니다.
그런데.. 예제로 주신게 메소드건 레코드건 모두 test 라 이해하기도 설명드리기도 정말 힘드네요. ^^
Reply | Threaded
Open this post in threaded view
|

Re: record 문의..

helplz
그럼 이게 어떤게 잘못 된건지 모르겟네요 ㅜㅠ

말씀하신대로

test.record(this, "test")
test2.record(this, "test")

를 주석 처리해도 같은 결과가 나와서요.. ㅜㅠ



역시나 성공이란 숫자는 높아졋다가 낮아 졋다가 합니다.

최종결과

Test 1       67           0            11.10        20.08        3.70         52095.84     192798.33    0            0.13         1.52         6.76          "www.daum.net"
Test 2       51           0            6.55         46.31        2.82         3433.43      9672.17      0            2.80         2.88         5.90          "www.naver.com"


테스트로 작성한 코드 입니다.

        public static void beforeProcess() {
                ProcessSelect = 0
                HTTPPluginControl.getConnectionDefaults().timeout = 6000
                test = new GTest(1, "www.daum.net")
                test2 = new GTest(2, "www.naver.com")
                request = new HTTPRequest()
                request2 = new HTTPRequest()
               
                test.record(request)
                test2.record(request2)
               
                grinder.logger.info("before process.");
        }

        @BeforeThread
        public void beforeThread() {
                /*
                test.record(this, "test")
                test2.record(this, "test2")
                */
                grinder.statistics.delayReports=true;
                grinder.logger.info("before thread.");
        }
       
        @Before
        public void before() {
                request.setHeaders(headers)
                request2.setHeaders(headers)
               
                cookies.each { CookieModule.addCookie(it, HTTPPluginControl.getThreadHTTPClientContext()) }
                grinder.logger.info("before thread. init headers and cookies");
        }

        @Test
        public void test(){
       
                HTTPResponse result
               
                if( ProcessSelect )
                {
                        grinder.logger.info('daum call')
                        result = request.GET("https://www.daum.net", params)

                        if (result.statusCode == 301 || result.statusCode == 302) {
                                grinder.logger.warn("Warning. The response may not be correct. The response code was {}.", result.statusCode);
                        } else {
                                assertThat(result.statusCode, is(200));
                        }
                }
        }
       
        @Test
        public void test2(){
       
                HTTPResponse result
               
                if( !ProcessSelect )
                {
                        grinder.logger.info('naver call')
                        result = request2.GET("https://www.naver.com", params)

                        if (result.statusCode == 301 || result.statusCode == 302) {
                                grinder.logger.warn("Warning. The response may not be correct. The response code was {}.", result.statusCode);
                        } else {
                                assertThat(result.statusCode, is(200));
                        }
                }
        }
       
       
        @Test
        public void test3(){
               
                if(!ProcessSelect)
                        ProcessSelect = !ProcessSelect
                       
                grinder.logger.info('processselect :' + ProcessSelect.toString())
                grinder.sleep(1000)
        }

무엇이 문제 일까요,,, naver.com 은 한번만 호출이 되거든요.. 그런데 naver.com 이 왜 성공 카운터가
1 을 초과 해서 올라 가는 것일까요...
로그를 봐도 naver call 은 한번만 기록 되어 있습니다..
Reply | Threaded
Open this post in threaded view
|

Re: record 문의..

junoyoon
Administrator
request.setHeaders(headers) 
 request2.setHeaders(headers) 

이 메소드가 매 테스트마다 호출되기 때문입니다.
앞서 설명드렸듯이 record한 객체의 메소드가 호출 성공하면 성공 카운트가 올라가거든요

2019년 7월 25일 (목) 오후 5:23, helplz [via ngrinder] <[hidden email]>님이 작성:
그럼 이게 어떤게 잘못 된건지 모르겟네요 ㅜㅠ

말씀하신대로

test.record(this, "test")
test2.record(this, "test")

를 주석 처리해도 같은 결과가 나와서요.. ㅜㅠ



역시나 성공이란 숫자는 높아졋다가 낮아 졋다가 합니다.

최종결과

Test 1       67           0            11.10        20.08        3.70         52095.84     192798.33    0            0.13         1.52         6.76          "www.daum.net"
Test 2       51           0            6.55         46.31        2.82         3433.43      9672.17      0            2.80         2.88         5.90          "www.naver.com"


테스트로 작성한 코드 입니다.

        public static void beforeProcess() {
                ProcessSelect = 0
                HTTPPluginControl.getConnectionDefaults().timeout = 6000
                test = new GTest(1, "www.daum.net")
                test2 = new GTest(2, "www.naver.com")
                request = new HTTPRequest()
                request2 = new HTTPRequest()
               
                test.record(request)
                test2.record(request2)
               
                grinder.logger.info("before process.");
        }

        @BeforeThread
        public void beforeThread() {
                /*
                test.record(this, "test")
                test2.record(this, "test2")
                */
                grinder.statistics.delayReports=true;
                grinder.logger.info("before thread.");
        }
       
        @Before
        public void before() {
                request.setHeaders(headers)
                request2.setHeaders(headers)
               
                cookies.each { CookieModule.addCookie(it, HTTPPluginControl.getThreadHTTPClientContext()) }
                grinder.logger.info("before thread. init headers and cookies");
        }

        @Test
        public void test(){
       
                HTTPResponse result
               
                if( ProcessSelect )
                {
                        grinder.logger.info('daum call')
                        result = request.GET("https://www.daum.net", params)

                        if (result.statusCode == 301 || result.statusCode == 302) {
                                grinder.logger.warn("Warning. The response may not be correct. The response code was {}.", result.statusCode);
                        } else {
                                assertThat(result.statusCode, is(200));
                        }
                }
        }
       
        @Test
        public void test2(){
       
                HTTPResponse result
               
                if( !ProcessSelect )
                {
                        grinder.logger.info('naver call')
                        result = request2.GET("https://www.naver.com", params)

                        if (result.statusCode == 301 || result.statusCode == 302) {
                                grinder.logger.warn("Warning. The response may not be correct. The response code was {}.", result.statusCode);
                        } else {
                                assertThat(result.statusCode, is(200));
                        }
                }
        }
       
       
        @Test
        public void test3(){
               
                if(!ProcessSelect)
                        ProcessSelect = !ProcessSelect
                       
                grinder.logger.info('processselect :' + ProcessSelect.toString())
                grinder.sleep(1000)
        }

무엇이 문제 일까요,,, naver.com 은 한번만 호출이 되거든요.. 그런데 naver.com 이 왜 성공 카운터가
1 을 초과 해서 올라 가는 것일까요...



If you reply to this email, your message will be added to the discussion below:
http://ngrinder.642.n7.nabble.com/record-tp2510p2518.html
To start a new topic under ngrinder-user-kr, email [hidden email]
To unsubscribe from ngrinder-user-kr, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: record 문의..

helplz
말씀하신

request.setHeaders(headers)
request2.setHeaders(headers)

을 다른쪽으로 옮겻더니 어느정도 원하는 답을 얻었습니다.

그런데,,

역시나 테스트 중일때 성공이란 숫자는 높아졋다가 다시 낮아졋다가 하는데..
이 숫자의 의미가 어떤것인지 모르겠습니다...
이 숫자는 어떤것에 대한 숫자가 표기 되는건가요?

그리고,,
성능 테스트를 시작 하면,, 스크립트 검증을 누르면 테스트를 한번 하는 것처럼
테스트를 한번 하고 시작 하는거 같습니다..  왜냐면 테스트 끝에 나오는 로그파일에
제가 호출할때 남기는 로그 수보다 최종결과에 적힌 수량이 하나 더 적더라구요.
제가 생각하는것이 맞는건가요?

그리고 마지막으로,,
제 코드가

@Test
public void test()

@Test
public void test2()

@Test
public void test3()

이렇게 되어 있는데 실행 순서가 로그를 보니 test -> test3 -> test2 이렇게 되더라구요..
test -> test2 -> test3 로 될줄 알았거든요..

실행 순서에 대한 정의가 어떻게 되는지 말씀해 주실수 있을까요?

답변에 항상 감사드립니다.
Reply | Threaded
Open this post in threaded view
|

Re: record 문의..

junoyoon
Administrator
성공은..  sample interval  마다 수집할때  record 하시기로한 메소드가 성공적으로 실행된 횟수 입니다. 
그래서 높아졌다 낮아졌다 하는 것이구요.

그리고 로그는 지맘대로 쓰레드 가 어떻게 뜨느냐에 따라 다르게 출력됩니다. 멀티 쓰레드 프로그램이기 때문에 자연스러운 겁니다.

그리고 테스트를 한번 하고 시작하지는 않습니다. 
그러나 ngrinder 자체가 테스트 횟수를 100회 하겠다고 하더라도 딱 100회만 실행되는 것을 보장하지는 않습니다.


2019년 7월 29일 (월) 오후 2:25, helplz [via ngrinder] <[hidden email]>님이 작성:
말씀하신

request.setHeaders(headers)
request2.setHeaders(headers)

을 다른쪽으로 옮겻더니 어느정도 원하는 답을 얻었습니다.

그런데,,

역시나 테스트 중일때 성공이란 숫자는 높아졋다가 다시 낮아졋다가 하는데..
이 숫자의 의미가 어떤것인지 모르겠습니다...
이 숫자는 어떤것에 대한 숫자가 표기 되는건가요?

그리고,,
성능 테스트를 시작 하면,, 스크립트 검증을 누르면 테스트를 한번 하는 것처럼
테스트를 한번 하고 시작 하는거 같습니다..  왜냐면 테스트 끝에 나오는 로그파일에
제가 호출할때 남기는 로그 수보다 최종결과에 적힌 수량이 하나 더 적더라구요.
제가 생각하는것이 맞는건가요?

그리고 마지막으로,,
제 코드가

@Test
public void test()

@Test
public void test2()

@Test
public void test3()

이렇게 되어 있는데 실행 순서가 로그를 보니 test -> test3 -> test2 이렇게 되더라구요..
test -> test2 -> test3 로 될줄 알았거든요..

실행 순서에 대한 정의가 어떻게 되는지 말씀해 주실수 있을까요?

답변에 항상 감사드립니다.


If you reply to this email, your message will be added to the discussion below:
http://ngrinder.642.n7.nabble.com/record-tp2510p2521.html
To start a new topic under ngrinder-user-kr, email [hidden email]
To unsubscribe from ngrinder-user-kr, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: record 문의..

helplz
궁금한 사항이 또 있습니다.. 제가 궁금해 하는 것들이 혹시 어디 메뉴얼 같은거에
적혀 있으면 그 url 을 알려주셔도 됩니다.. 제가 이런 메뉴얼이 있는데 못찾아서
자꾸 질문하는거 같아서요..

일단 궁금한 사항 입니다..

가상유저 스레드를 1로 테스트를 하는데도 로그 순서가 마음대로 되는 건가요?

로그를 남기는 시스템이 멀티스레드로 돌아가는 건가요?
그리고 멀티쓰레드로 로그 시스템이 돌아간다고 해도..

POST 로 요청하기 전에 로그를 남기는데
로그 횟수가 7번 인데

최종결과에 6번이라고 찍히면서 서로 불일치가 일어날수 있는 건가요?
실제 호출 횟수와 샘플링에 따라서 수량은 차이가 날수 있는건가요?

마지막으로,,, 이제 곧 테스트 해보려고 하는거긴 한데..
ngrinder 는 멀티스레드의 임계영역은 어떻게 처리되는건가 해서요
가상유저를 100으로 설정한 후에 스레드에서 프로세스영역 메모리를
++ 하다가 100이 되면 일을 시켜보려고 하는데..
보통 lock 을 거는데 ngrinder는 그럴필요가 없는건가 해서요