This post was updated on .
안녕하세요.
MySQL 간단한 테스트입니다. 총 Vuser는 1로 했습니다. 스크립트 검증에서는 제대로 동작하는걸 확인한 후 성능 테스트 하려고 하니, Script Error가 계속 납니다.. 아래 에러에 대해 어떻게 조치해야 하는지 궁금합니다. ****************************** 컨트롤러 버전 : 3.4 -- 윈도우7 / Oracle JDK 1.7 -- 컨트롤러 log는 다음과 같습니다. ****************************** 2016-07-06 14:21:10,367 INFO AgentManager.java:405 : 1 agents are starting for user admin 2016-07-06 14:21:10,367 INFO AgentManager.java:407 : - Agent prismi2-oasis-db-dev 2016-07-06 14:21:12,784 INFO Home.java:241 : C:\Users\db004\.ngrinder\perftest\0_999\13\report is created. 2016-07-06 14:21:13,299 INFO Home.java:241 : C:\Users\db004\.ngrinder\perftest\0_999\13\logs is created. 2016-07-06 14:21:16,386 ERROR PerfTestRunnable.java:347 : Abnormal test 13 due to SCRIPT_ERROR 2016-07-06 14:21:17,260 INFO PerfTestRunnable.java:412 : Terminate 13 2016-07-06 14:21:17,260 INFO PerfTestService.java:961 : Total Statistics for test 13 is {} 2016-07-06 14:21:22,469 WARN PerfTestService.java:713 : Report TPS for test 13 does not exist. ****************************** -- Agent 3.4 -- RHEL6.5 / Oracle JDK 1.7 -- agent log는 다음과 같습니다. ****************************** 2016-07-06 14:33:34,676 INFO agent controller : Received a start agent message 2016-07-06 14:33:34,677 INFO agent controller : Agent start message is received from controller net.grinder.messages.agent.StartGrinderMessage@3d8290a3 2016-07-06 14:33:34,677 INFO agent controller : Starting agent... for test_13 2016-07-06 14:33:34,678 INFO agent daemon : Agent daemon connecting to port 12000 is started. 2016-07-06 14:33:34,680 INFO agent controller : Agent is started. Waiting for agent controller signal 2016-07-06 14:33:34,684 INFO agent daemon : The Grinder 3.9.1 2016-07-06 14:33:34,703 INFO agent daemon : Connect to console at /90.90.10.239:12000 2016-07-06 14:33:34,703 INFO agent daemon : Waiting for console signal 2016-07-06 14:33:35,555 INFO agent daemon : Clearing file store 2016-07-06 14:33:35,559 INFO agent daemon : Updating file store: "test3.py" (2146 bytes) 2016-07-06 14:33:35,596 INFO agent daemon : Updating file store: "lib/mysql-connector-java-5.1.39-bin.jar" (989497 bytes) 2016-07-06 14:33:37,089 INFO agent daemon : received a start message 2016-07-06 14:33:37,095 INFO agent daemon : log file : /home/mysql/.ngrinder_agent/log/test_13/prismi2-oasis-db-dev-0.log 2016-07-06 14:33:37,104 INFO agent daemon : grinder properties {grinder.security=false, grinder.ignoreSampleCount=0, grinder.numberOfOldLogs=1, grinder.script=test3.py, grinder.consoleHost=90.90.10.239, grinder.runs=1, grinder.logProcessStreams=true, grinder.jvm=java, grinder.sleepTimeFactor=1, grinder.reportToConsole.interval=500, grinder.dcrinstrumentation=true, grinder.reportTimesToConsole=true, grinder.processes=1, grinder.threads=1, grinder.useConsole=true, grinder.test.id=test_13, grinder.debug.singleprocess=false, grinder.agents=1, grinder.consolePort=12000, grinder.jvm.classpath=/data2/ngrinder/ngrinder-agent/lib/ngrinder-runtime-3.4.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-patch-3.9.1-patch.jar:/home/mysql/.ngrinder_agent/file-store/admin/current/:/home/mysql/.ngrinder_agent/file-store/admin/current/lib:/home/mysql/.ngrinder_agent/file-store/admin/current/lib/mysql-connector-java-5.1.39-bin.jar, grinder.logDirectory=/home/mysql/.ngrinder_agent/log/test_13, ngrinder.etc.hosts=, grinder.sleepTimeVariation=0.2, grinder.processIncrement=0, grinder.user=admin} 2016-07-06 14:33:37,104 INFO agent daemon : jvm arguments -Djna.library.path=/home/mysql/.ngrinder_agent/file-store/admin/current/lib -Dpython.path=/home/mysql/.ngrinder_agent/file-store/admin/current/lib -Dpython.cachedir=/tmp/jython -Dngrinder.etc.hosts=prismi2-oasis-db-dev:127.0.0.1,localhost:127.0.0.1 -Dsun.net.spi.nameservice.provider.1=dns,LocalManagedDns -Xms1024m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=128m 2016-07-06 14:33:37,115 INFO agent daemon : Worker process command line: java '-javaagent:/data2/ngrinder/ngrinder-agent/lib/grinder-dcr-agent-3.9.1.jar' '-Djna.library.path=/home/mysql/.ngrinder_agent/file-store/admin/current/lib' '-Dpython.path=/home/mysql/.ngrinder_agent/file-store/admin/current/lib' '-Dpython.cachedir=/tmp/jython' '-Dngrinder.etc.hosts=prismi2-oasis-db-dev:127.0.0.1,localhost:127.0.0.1' '-Dsun.net.spi.nameservice.provider.1=dns,LocalManagedDns' '-Xms1024m' '-Xmx1024m' '-XX:PermSize=128m' '-XX:MaxPermSize=128m' -classpath '/data2/ngrinder/ngrinder-agent/lib/ngrinder-runtime-3.4.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-patch-3.9.1-patch.jar:.:lib:lib/mysql-connector-java-5.1.39-bin.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-core-3.9.1.jar:/data2/ngrinder/ngrinder-agent/lib/commons-io-2.0.1.jar:/data2/ngrinder/ngrinder-agent/lib/hamcrest-all-1.1.jar:/data2/ngrinder/ngrinder-agent/lib/jython-standalone-2.5.3.jar:/data2/ngrinder/ngrinder-agent/lib/json-20090211.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-httpclient-3.9.1.jar:/data2/ngrinder/ngrinder-agent/lib/asm-3.3.1.jar:/data2/ngrinder/ngrinder-agent/lib/junit-dep-4.8.2.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-dcr-agent-3.9.1.jar:/data2/ngrinder/ngrinder-agent/lib/dnsjava-2.1.1.jar:/data2/ngrinder/ngrinder-agent/lib/logback-classic-1.0.0.jar:/data2/ngrinder/ngrinder-agent/lib/ngrinder-runtime-3.4.jar:/data2/ngrinder/ngrinder-agent/lib/logback-core-1.0.0.jar:/data2/ngrinder/ngrinder-agent/lib/slf4j-api-1.6.4.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-http-3.9.1.jar:/data2/ngrinder/ngrinder-agent/lib/commons-lang-2.6.jar:/data2/ngrinder/ngrinder-agent/lib/picocontainer-2.13.6.jar' net.grinder.engine.process.WorkerProcessEntryPoint 2016-07-06 14:33:37,127 INFO agent daemon : worker prismi2-oasis-db-dev-0 started 2016-07-06 14:33:37,498 INFO agent daemon : All workers are finished 2016-07-06 14:33:37,501 INFO agent daemon : communication shut down 2016-07-06 14:33:37,504 INFO agent daemon : Test shuts down. 2016-07-06 14:33:37,505 INFO agent controller : Send log for test_13 2016-07-06 14:33:37,514 INFO agent controller : Clean up the perftest logs ****************************** 성능 테스트 후 나온 로그는 다음과 같습니다. ****************************** java '-javaagent:/data2/ngrinder/ngrinder-agent/lib/grinder-dcr-agent-3.9.1.jar' '-Djna.library.path=/home/mysql/.ngrinder_agent/file-store/admin/current/lib' '-Dpython.path=/home/mysql/.ngrinder_agent/file-store/admin/current/lib' '-Dpython.cachedir=/tmp/jython' '-Dngrinder.etc.hosts=prismi2-oasis-db-dev:127.0.0.1,localhost:127.0.0.1' '-Dsun.net.spi.nameservice.provider.1=dns,LocalManagedDns' '-Xms1024m' '-Xmx1024m' '-XX:PermSize=128m' '-XX:MaxPermSize=128m' -classpath '/data2/ngrinder/ngrinder-agent/lib/ngrinder-runtime-3.4.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-patch-3.9.1-patch.jar:.:lib:lib/mysql-connector-java-5.1.39-bin.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-core-3.9.1.jar:/data2/ngrinder/ngrinder-agent/lib/commons-io-2.0.1.jar:/data2/ngrinder/ngrinder-agent/lib/hamcrest-all-1.1.jar:/data2/ngrinder/ngrinder-agent/lib/jython-standalone-2.5.3.jar:/data2/ngrinder/ngrinder-agent/lib/json-20090211.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-httpclient-3.9.1.jar:/data2/ngrinder/ngrinder-agent/lib/asm-3.3.1.jar:/data2/ngrinder/ngrinder-agent/lib/junit-dep-4.8.2.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-dcr-agent-3.9.1.jar:/data2/ngrinder/ngrinder-agent/lib/dnsjava-2.1.1.jar:/data2/ngrinder/ngrinder-agent/lib/logback-classic-1.0.0.jar:/data2/ngrinder/ngrinder-agent/lib/ngrinder-runtime-3.4.jar:/data2/ngrinder/ngrinder-agent/lib/logback-core-1.0.0.jar:/data2/ngrinder/ngrinder-agent/lib/slf4j-api-1.6.4.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-http-3.9.1.jar:/data2/ngrinder/ngrinder-agent/lib/commons-lang-2.6.jar:/data2/ngrinder/ngrinder-agent/lib/picocontainer-2.13.6.jar' net.grinder.engine.process.WorkerProcessEntryPoint ****************************** 스크립트 검증 로그는 다음과 같습니다. ****************************** 2016-07-06 14:48:24,753 INFO The Grinder version 3.9.1 2016-07-06 14:48:24,753 INFO Java(TM) SE Runtime Environment 1.7.0_79-b15: Java HotSpot(TM) 64-Bit Server VM (24.79-b02, mixed mode) on Windows 7 amd64 6.1 2016-07-06 14:48:24,768 INFO time zone is KST (+0900) 2016-07-06 14:48:24,877 INFO worker process 0 of agent number 0 2016-07-06 14:48:24,940 INFO Instrumentation agents: byte code transforming instrumenter for Jython 2.5; byte code transforming instrumenter for Java 2016-07-06 14:48:27,669 INFO Running "test3.py" using Jython 2.5.3 (2.5:c56500f08d34+, Aug 13 2012, 14:54:35) [Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] 2016-07-06 14:48:27,685 INFO starting, will do 1 run 2016-07-06 14:48:27,685 INFO Start time is 1467784107689 ms since Epoch 2016-07-06 14:48:27,763 INFO finished 1 run 2016-07-06 14:48:27,763 INFO elapsed time is 81 ms 2016-07-06 14:48:27,763 INFO Final statistics for this process: 2016-07-06 14:48:27,779 INFO Tests Errors Mean Test Test Time TPS Time (ms) Standard Deviation (ms) Totals 0 0 ? 0.00 0.00 Tests resulting in error only contribute to the Errors column. Statistics for individual tests can be found in the data file, including (possibly incomplete) statistics for erroneous tests. Composite tests are marked with () and not included in the totals. 2016-07-06 14:48:27,669 INFO validation-0: Starting threads 2016-07-06 14:48:27,779 INFO validation-0: Finished ****************************** -- script는 다음과 같습니다. ****************************** # -*- coding:utf-8 -*- # Database test. # from java.sql import DriverManager from net.grinder.script.Grinder import grinder from net.grinder.script import Test from com.mysql.jdbc import Driver from java.util import Random from java.lang import System test1 = Test(1, "Database insert") test2 = Test(2, "Database update") random = Random(long(System.nanoTime())) # Load the JDBC driver. DriverManager.registerDriver(Driver()) #DB_connect = "jdbc:mysql://80.80.11.56:3306/emp" #DB_user = "root" #DB_password = "mysql" def getConnection(): return DriverManager.getConnection("jdbc:mysql://80.80.11.56:3306/emp", "root", "mysql") def ensureClosed(object): try: object.close() except: pass # One time initialization that cleans out old data. connection = getConnection() statement = connection.createStatement() # initialize the table should want to test. statement.execute("drop table if exists ngrinder_update_temp") statement.execute("create table ngrinder_update_temp(testid integer, test_number integer)") ensureClosed(statement) ensureClosed(connection) class TestRunner: def __call__(self): connection = None updateStatement = None insertStatement = None try: # in this test, we will create connection and statement in every test transaction. connection = getConnection() updateStatement = connection.createStatement() insertStatement = connection.createStatement() insertStatement = test1.wrap(insertStatement) tmpId = random.nextInt(1024000) insertStatement.execute("insert into ngrinder_update_temp values(%d, %d)" % (tmpId, random.nextInt(1024000))) updateStatement = test2.wrap(updateStatement) updateStatement.execute("update ngrinder_update_temp set test_number=%d where testid=%d" % (random.nextInt(1024000), tmpId)) finally: ensureClosed(updateStatement) ensureClosed(insertStatement) ensureClosed(connection) 감사합니다. |
안녕하세요.
해당 스크립트에 보면 record 해주는 부분이 빠져있습니다. nGrinder sampling 작업에서 에러가 나는 걸로 확인 됩니다. nGrinder 테스트 템플릿을 보시면 def __init__(self): test1.record(TestRunner.__call__) grinder.statistics.delayReports=True pass 이런 record 코드가 존재 합니다. TestRunner 안에 __init__ record 코드를 추가로 삽입 한 후에 테스트 진행해 보시길 바랍니다. 감사합니다. |
안녕하세요.
답변 감사드립니다. 해당 부분 스크립트에 넣어서 테스트 해보았는데요. 스크립트 검증은 잘 되지만, 성능 테스트에서 여전히 동일한 결과를 보입니다.. ****************************** 컨트롤러 버전 : 3.4 -- 윈도우7 / Oracle JDK 1.7 -- 컨트롤러 log는 다음과 같습니다. ****************************** 2016-07-07 12:34:27,243 INFO FrameworkServlet.java:488 : FrameworkServlet 'appServlet': initialization started 2016-07-07 12:34:28,002 INFO FrameworkServlet.java:507 : FrameworkServlet 'appServlet': initialization completed in 759 ms 2016-07-07 12:34:37,158 ERROR HomeService.java:108 : Error while patching the feed entries for http://ngrinder.642.n7.nabble.com/ngrinder-user-en-f50.xml : ngrinder.642.n7.nabble.com 2016-07-07 12:34:51,768 ERROR HomeService.java:108 : Error while patching the feed entries for https://github.com/naver/ngrinder/wiki.atom : github.com 2016-07-07 12:34:58,885 INFO HomeController.java:262 : Login Failure No authentication 2016-07-07 12:35:03,996 INFO NGrinderAuthenticationProvider.java:111 : admin is logined by org.ngrinder.security.DefaultLoginPlugin 2016-07-07 12:35:15,761 ERROR HomeService.java:108 : Error while patching the feed entries for http://ngrinder.642.n7.nabble.com/ngrinder-user-kr-f113.xml : ngrinder.642.n7.nabble.com 2016-07-07 12:36:47,495 INFO ScriptHandler.java:153 : 80.80.11.56/lib/mysql-connector-java-5.1.39-bin.jar is being written in C:\Users\db004\.ngrinder\script\admin\lib for test 0 2016-07-07 12:36:47,557 INFO LocalScriptTestDriveService.java:107 : grinder.jvm.classpath : /C:/Users/db004/.ngrinder/tmp/webapp/WEB-INF/lib/ngrinder-runtime-3.4.jar;/C:/Users/db004/.ngrinder/tmp/webapp/WEB-INF/lib/grinder-patch-3.9.1-patch.jar;/C:/Users/db004/.ngrinder/tmp/webapp/WEB-INF/lib/plexus-sec-dispatcher-1.3.jar;C:\Users\db004\.ngrinder\script\admin;C:\Users\db004\.ngrinder\script\admin\lib;C:\Users\db004\.ngrinder\script\admin\lib\mysql-connector-java-5.1.39-bin.jar 2016-07-07 12:36:47,557 INFO LocalScriptTestDriveService.java:117 : jvm args : -Djna.library.path=C:\Users\db004\.ngrinder\script\admin\lib -Dpython.path=C:\Users\db004\.ngrinder\script\admin\lib -Dpython.cachedir=C:\Users\db004\AppData\Local\Temp\jython -Dngrinder.etc.hosts=ENOW1011:127.0.0.1,localhost:127.0.0.1 -Dsun.net.spi.nameservice.provider.1=dns,LocalManagedDns 2016-07-07 12:36:47,588 INFO ErrorStreamRedirectWorkerLauncher.java:127 : worker validation-0 started 2016-07-07 12:37:39,079 INFO Home.java:241 : C:\Users\db004\.ngrinder\perftest\0_999\1 is created. 2016-07-07 12:37:39,079 INFO Home.java:241 : C:\Users\db004\.ngrinder\perftest\0_999\1\dist is created. 2016-07-07 12:37:39,188 INFO ScriptHandler.java:153 : 80.80.11.56/lib/mysql-connector-java-5.1.39-bin.jar is being written in C:\Users\db004\.ngrinder\perftest\0_999\1\dist\lib for test 1 2016-07-07 12:37:39,235 INFO ScriptHandler.java:153 : 80.80.11.56/test3.py is being written in C:\Users\db004\.ngrinder\perftest\0_999\1\dist for test 1 2016-07-07 12:37:39,250 INFO PerfTestService.java:656 : File write is completed in C:\Users\db004\.ngrinder\perftest\0_999\1\dist 2016-07-07 12:37:39,250 INFO PerfTestService.java:629 : Grinder Properties : {grinder.threads=1, grinder.numberOfOldLogs=1, grinder.jvm.classpath=.;lib;lib/mysql-connector-java-5.1.39-bin.jar, grinder.test.id=test_1, grinder.duration=60000, grinder.sleepTimeVariation=0.2, grinder.runs=0, grinder.useConsole=true, grinder.script=test3.py, grinder.jvm=java, grinder.security=false, grinder.processIncrement=0, grinder.sleepTimeFactor=1, ngrinder.etc.hosts=, grinder.user=admin, grinder.reportTimesToConsole=true, grinder.debug.singleprocess=false, grinder.processes=1, grinder.ignoreSampleCount=0, grinder.reportToConsole.interval=500, grinder.agents=1, grinder.dcrinstrumentation=true, grinder.logProcessStreams=true} 2016-07-07 12:37:39,250 INFO AgentManager.java:405 : 1 agents are starting for user admin 2016-07-07 12:37:39,250 INFO AgentManager.java:407 : - Agent prismi2-oasis-db-dev 2016-07-07 12:37:40,715 INFO Home.java:241 : C:\Users\db004\.ngrinder\perftest\0_999\1\report is created. 2016-07-07 12:37:41,369 INFO Home.java:241 : C:\Users\db004\.ngrinder\perftest\0_999\1\logs is created. 2016-07-07 12:37:45,296 ERROR PerfTestRunnable.java:347 : Abnormal test 1 due to SCRIPT_ERROR 2016-07-07 12:37:46,122 INFO PerfTestRunnable.java:412 : Terminate 1 2016-07-07 12:37:46,122 INFO PerfTestService.java:961 : Total Statistics for test 1 is {} 2016-07-07 12:37:50,843 WARN PerfTestService.java:713 : Report TPS for test 1 does not exist. ****************************** -- Agent 3.4 -- RHEL6.5 / Oracle JDK 1.7 -- agent log는 다음과 같습니다. ****************************** 2016-07-07 12:46:50,242 INFO agent controller : Connected to agent controller server at /90.90.10.239:16001 2016-07-07 12:46:50,243 INFO agent controller : Waiting for agent controller server signal 2016-07-07 12:50:04,311 INFO agent controller : Received a start agent message 2016-07-07 12:50:04,312 INFO agent controller : Agent start message is received from controller net.grinder.messages.agent.StartGrinderMessage@2bce105 2016-07-07 12:50:04,312 INFO agent controller : Starting agent... for test_1 2016-07-07 12:50:04,312 INFO agent daemon : Agent daemon connecting to port 12000 is started. 2016-07-07 12:50:04,313 INFO agent controller : Agent is started. Waiting for agent controller signal 2016-07-07 12:50:04,313 INFO agent daemon : The Grinder 3.9.1 2016-07-07 12:50:04,315 INFO agent daemon : Connect to console at /90.90.10.239:12000 2016-07-07 12:50:04,315 INFO agent daemon : Waiting for console signal 2016-07-07 12:50:04,702 INFO agent daemon : Clearing file store 2016-07-07 12:50:04,704 INFO agent daemon : Updating file store: "test3.py" (2280 bytes) 2016-07-07 12:50:04,746 INFO agent daemon : Updating file store: "lib/mysql-connector-java-5.1.39-bin.jar" (989497 bytes) 2016-07-07 12:50:05,774 INFO agent daemon : received a start message 2016-07-07 12:50:05,779 INFO agent daemon : log file : /root/.ngrinder_agent/log/test_1/prismi2-oasis-db-dev-0.log 2016-07-07 12:50:05,780 INFO agent daemon : grinder properties {grinder.security=false, grinder.ignoreSampleCount=0, grinder.numberOfOldLogs=1, grinder.script=test3.py, grinder.consoleHost=90.90.10.239, grinder.runs=0, grinder.logProcessStreams=true, grinder.jvm=java, grinder.sleepTimeFactor=1, grinder.reportToConsole.interval=500, grinder.dcrinstrumentation=true, grinder.reportTimesToConsole=true, grinder.processes=1, grinder.threads=1, grinder.useConsole=true, grinder.test.id=test_1, grinder.debug.singleprocess=false, grinder.agents=1, grinder.consolePort=12000, grinder.jvm.classpath=/data2/ngrinder/ngrinder-agent/lib/ngrinder-runtime-3.4.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-patch-3.9.1-patch.jar:/root/.ngrinder_agent/file-store/admin/current/:/root/.ngrinder_agent/file-store/admin/current/lib:/root/.ngrinder_agent/file-store/admin/current/lib/mysql-connector-java-5.1.39-bin.jar, grinder.logDirectory=/root/.ngrinder_agent/log/test_1, grinder.duration=60000, ngrinder.etc.hosts=, grinder.sleepTimeVariation=0.2, grinder.processIncrement=0, grinder.user=admin} 2016-07-07 12:50:05,780 INFO agent daemon : jvm arguments -Djna.library.path=/root/.ngrinder_agent/file-store/admin/current/lib -Dpython.path=/root/.ngrinder_agent/file-store/admin/current/lib -Dpython.cachedir=/tmp/jython -Dngrinder.etc.hosts=prismi2-oasis-db-dev:127.0.0.1,localhost:127.0.0.1 -Dsun.net.spi.nameservice.provider.1=dns,LocalManagedDns -Xms1024m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=128m 2016-07-07 12:50:05,784 INFO agent daemon : Worker process command line: java '-javaagent:/data2/ngrinder/ngrinder-agent/lib/grinder-dcr-agent-3.9.1.jar' '-Djna.library.path=/root/.ngrinder_agent/file-store/admin/current/lib' '-Dpython.path=/root/.ngrinder_agent/file-store/admin/current/lib' '-Dpython.cachedir=/tmp/jython' '-Dngrinder.etc.hosts=prismi2-oasis-db-dev:127.0.0.1,localhost:127.0.0.1' '-Dsun.net.spi.nameservice.provider.1=dns,LocalManagedDns' '-Xms1024m' '-Xmx1024m' '-XX:PermSize=128m' '-XX:MaxPermSize=128m' -classpath '/data2/ngrinder/ngrinder-agent/lib/ngrinder-runtime-3.4.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-patch-3.9.1-patch.jar:.:lib:lib/mysql-connector-java-5.1.39-bin.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-core-3.9.1.jar:/data2/ngrinder/ngrinder-agent/lib/commons-io-2.0.1.jar:/data2/ngrinder/ngrinder-agent/lib/hamcrest-all-1.1.jar:/data2/ngrinder/ngrinder-agent/lib/jython-standalone-2.5.3.jar:/data2/ngrinder/ngrinder-agent/lib/json-20090211.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-httpclient-3.9.1.jar:/data2/ngrinder/ngrinder-agent/lib/asm-3.3.1.jar:/data2/ngrinder/ngrinder-agent/lib/junit-dep-4.8.2.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-dcr-agent-3.9.1.jar:/data2/ngrinder/ngrinder-agent/lib/dnsjava-2.1.1.jar:/data2/ngrinder/ngrinder-agent/lib/logback-classic-1.0.0.jar:/data2/ngrinder/ngrinder-agent/lib/ngrinder-runtime-3.4.jar:/data2/ngrinder/ngrinder-agent/lib/logback-core-1.0.0.jar:/data2/ngrinder/ngrinder-agent/lib/slf4j-api-1.6.4.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-http-3.9.1.jar:/data2/ngrinder/ngrinder-agent/lib/commons-lang-2.6.jar:/data2/ngrinder/ngrinder-agent/lib/picocontainer-2.13.6.jar' net.grinder.engine.process.WorkerProcessEntryPoint 2016-07-07 12:50:05,787 INFO agent daemon : worker prismi2-oasis-db-dev-0 started 2016-07-07 12:50:06,187 INFO agent daemon : All workers are finished 2016-07-07 12:50:06,188 INFO agent daemon : communication shut down 2016-07-07 12:50:06,189 INFO agent daemon : Test shuts down. 2016-07-07 12:50:06,190 INFO agent controller : Send log for test_1 2016-07-07 12:50:06,191 INFO agent controller : Clean up the perftest logs ****************************** 성능 테스트 후 나온 로그는 다음과 같습니다. ****************************** java '-javaagent:/data2/ngrinder/ngrinder-agent/lib/grinder-dcr-agent-3.9.1.jar' '-Djna.library.path=/root/.ngrinder_agent/file-store/admin/current/lib' '-Dpython.path=/root/.ngrinder_agent/file-store/admin/current/lib' '-Dpython.cachedir=/tmp/jython' '-Dngrinder.etc.hosts=prismi2-oasis-db-dev:127.0.0.1,localhost:127.0.0.1' '-Dsun.net.spi.nameservice.provider.1=dns,LocalManagedDns' '-Xms1024m' '-Xmx1024m' '-XX:PermSize=128m' '-XX:MaxPermSize=128m' -classpath '/data2/ngrinder/ngrinder-agent/lib/ngrinder-runtime-3.4.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-patch-3.9.1-patch.jar:.:lib:lib/mysql-connector-java-5.1.39-bin.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-core-3.9.1.jar:/data2/ngrinder/ngrinder-agent/lib/commons-io-2.0.1.jar:/data2/ngrinder/ngrinder-agent/lib/hamcrest-all-1.1.jar:/data2/ngrinder/ngrinder-agent/lib/jython-standalone-2.5.3.jar:/data2/ngrinder/ngrinder-agent/lib/json-20090211.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-httpclient-3.9.1.jar:/data2/ngrinder/ngrinder-agent/lib/asm-3.3.1.jar:/data2/ngrinder/ngrinder-agent/lib/junit-dep-4.8.2.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-dcr-agent-3.9.1.jar:/data2/ngrinder/ngrinder-agent/lib/dnsjava-2.1.1.jar:/data2/ngrinder/ngrinder-agent/lib/logback-classic-1.0.0.jar:/data2/ngrinder/ngrinder-agent/lib/ngrinder-runtime-3.4.jar:/data2/ngrinder/ngrinder-agent/lib/logback-core-1.0.0.jar:/data2/ngrinder/ngrinder-agent/lib/slf4j-api-1.6.4.jar:/data2/ngrinder/ngrinder-agent/lib/grinder-http-3.9.1.jar:/data2/ngrinder/ngrinder-agent/lib/commons-lang-2.6.jar:/data2/ngrinder/ngrinder-agent/lib/picocontainer-2.13.6.jar' net.grinder.engine.process.WorkerProcessEntryPoint ****************************** 스크립트 검증 로그는 다음과 같습니다. ****************************** 2016-07-07 12:49:18,138 INFO The Grinder version 3.9.1 2016-07-07 12:49:18,138 INFO Java(TM) SE Runtime Environment 1.7.0_79-b15: Java HotSpot(TM) 64-Bit Server VM (24.79-b02, mixed mode) on Windows 7 amd64 6.1 2016-07-07 12:49:18,153 INFO time zone is KST (+0900) 2016-07-07 12:49:18,278 INFO worker process 0 of agent number 0 2016-07-07 12:49:18,340 INFO Instrumentation agents: byte code transforming instrumenter for Jython 2.5; byte code transforming instrumenter for Java 2016-07-07 12:49:21,023 INFO Running "test3.py" using Jython 2.5.3 (2.5:c56500f08d34+, Aug 13 2012, 14:54:35) [Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] 2016-07-07 12:49:21,085 INFO starting, will do 1 run 2016-07-07 12:49:21,085 INFO Start time is 1467863361097 ms since Epoch 2016-07-07 12:49:21,132 INFO finished 1 run 2016-07-07 12:49:21,132 INFO elapsed time is 46 ms 2016-07-07 12:49:21,132 INFO Final statistics for this process: 2016-07-07 12:49:21,148 INFO Tests Errors Mean Test Test Time TPS Time (ms) Standard Deviation (ms) Test 1 1 0 38.00 0.00 21.74 "Database insert" Totals 1 0 38.00 0.00 21.74 Tests resulting in error only contribute to the Errors column. Statistics for individual tests can be found in the data file, including (possibly incomplete) statistics for erroneous tests. Composite tests are marked with () and not included in the totals. 2016-07-07 12:49:21,038 INFO validation-0: Starting threads 2016-07-07 12:49:21,148 INFO validation-0: Finished ****************************** -- script는 다음과 같습니다. ****************************** # -*- coding:utf-8 -*- # Database test. # from java.sql import DriverManager from net.grinder.script.Grinder import grinder from net.grinder.script import Test from com.mysql.jdbc import Driver from java.util import Random from java.lang import System test1 = Test(1, "Database insert") test2 = Test(2, "Database update") random = Random(long(System.nanoTime())) # Load the JDBC driver. DriverManager.registerDriver(Driver()) #DB_connect = "jdbc:mysql://80.80.11.56:3306/emp" #DB_user = "root" #DB_password = "mysql" def getConnection(): return DriverManager.getConnection("jdbc:mysql://80.80.11.56:3306/emp", "root", "mysql") def ensureClosed(object): try: object.close() except: pass # One time initialization that cleans out old data. connection = getConnection() statement = connection.createStatement() # initialize the table should want to test. statement.execute("drop table if exists ngrinder_update_temp") statement.execute("create table ngrinder_update_temp(testid integer, test_number integer)") ensureClosed(statement) ensureClosed(connection) class TestRunner: def __init__(self): test1.record(TestRunner.__call__) grinder.statistics.delayReports=True pass def __call__(self): connection = None updateStatement = None insertStatement = None try: # in this test, we will create connection and statement in every test transaction. connection = getConnection() updateStatement = connection.createStatement() insertStatement = connection.createStatement() insertStatement = test1.wrap(insertStatement) tmpId = random.nextInt(1024000) insertStatement.execute("insert into ngrinder_update_temp values(%d, %d)" % (tmpId, random.nextInt(1024000))) updateStatement = test2.wrap(updateStatement) updateStatement.execute("update ngrinder_update_temp set test_number=%d where testid=%d" % (random.nextInt(1024000), tmpId)) finally: ensureClosed(updateStatement) ensureClosed(insertStatement) ensureClosed(connection) |
In reply to this post by kevin yun
test1.wrap(insertStatement) 은 더이상 지원하지 않는 소스 입니다.
wrap은 제거 하시고 테스트 진행해 보시길 바랍니다. |
Free forum by Nabble | Edit this page |