Author Topic: เปิด debug log on gatling.io  (Read 4799 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
เปิด debug log on gatling.io
« on: กุมภาพันธ์ 11, 2016, 07:13:54 PM »
ปกติดู log จะช่วยในการ debug code ครับ ดูพวก session , reply , post , get
วิธีการคือเปิด ที่เข้าไปที่ไฟล์ logback.xml

ลบ comment ของบันทัดข้างล่างออก แบบนี้ <!-- กับ -->
 <logger name="io.gatling.http.ahc" level="TRACE" />

แล้วทำการ save file logback.xml
แล้วให้รัน gatling.sh อีกรอบ ก็จะแสดงค่า debug ออกมาครับ

หลังจาก debug เสร็จก็ทำการ comment กลับด้วยนะครับผม
จะได้ไม่โหลดเครื่องตอนเทสจริง ครับ : )

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: เปิด debug log on gatling.io
« Reply #1 on: กุมภาพันธ์ 12, 2016, 03:16:47 PM »
##การเปิด เชค status OK,KO , status 200 ในส่วนของ simulation.log

ทำการเพิ่ม  .extraInfoExtractor(extraInfo => List("extraInfo.response.bodyLength.status.session")) ลงในส่วนของ httpProtocol = http

ตามข้างล่างครับ

   val httpProtocol = http
                          .extraInfoExtractor(extraInfo => List("extraInfo.response.bodyLength.status.session"))

หลังจากรัน gatling.sh เสร็จทำการเชค log ใน result/file_folder/simulation.log
TFS.LOGIN       login   RUN     1455260774486           2.0
LOGIN   8349452080966449052-0   USER    START   1455260774529   0
LOGIN   8349452080966449052-1   USER    START   1455260775296   0
LOGIN   8349452080966449052-2   USER    START   1455260775816   0
LOGIN   8349452080966449052-3   USER    START   1455260776246   0
LOGIN   8349452080966449052-3   REQUEST         EXCL_1_Login_LoadScreen 1455260776248   1455260776253   1455260776263   1455260776263   KO      status.find.is(200), but actually found 500     extraInfo.response.bodyLength.status.session