저라면 이렇게 하겠습니다.
# -*- coding:utf-8 -*-
# A simple example using the HTTP plugin that shows the retrieval of a
# single page via HTTP.
#
# This script is auto generated by ngrinder.
#
# @author 윤준호
from net.grinder.script.Grinder import grinder
from net.grinder.script import Test
from net.grinder.plugin.http import HTTPRequest
from net.grinder.plugin.http import HTTPPluginControl
control = HTTPPluginControl.getConnectionDefaults()
# if you don't want that HTTPRequest follows the redirection, please modify the following option 0.
# control.followRedirects = 1
# if you want to increase the timeout, please modify the following option.
control.timeout = 6000
test1 = Test(1, "Test1")
request1 = HTTPRequest()
# Make any method call on request1 increase TPS
test1.record(request1)
class TestRunner:
# initlialize a thread
def __init__(self):
grinder.statistics.delayReports=True
self.pages = [ TestRunner.loginPage, TestRunner.mainPage, TestRunner.secondPage]
def loginPage(self):
return request1.GET("http://naver.com")
def mainPage(self):
return request1.GET("http://naver.com")
def secondPage(self):
return request1.GET("http://naver.com")
# test method
def __call__(self):
for each in self.pages :
result = each(self)
if result.getStatusCode() != 200 :
grinder.statistics.forLastTest.setSuccess(False)
return
grinder.statistics.forLastTest.setSuccess(True)