일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- prompt
- Network
- fdisk
- 연산자
- perl one-liner
- Linux
- 오라클
- oracle
- perl string
- php5
- Unix
- rac
- perl + 정규표현식
- MySQL
- dba
- Oracle RAC
- oracle install
- bash
- command & perl
- SQL
- PERL
- RHEL4
- mariaDB
- memory
- grid
- cygwin
- solaris
- patch
- solaris network
- sqlplus
Archives
- Today
- Total
DATA 전문가로 가는 길
[TIP][성능측정도구] NHN - nGrinder MariaDB/MySQL 접속 방법(mysql.jdbc) 본문
nGrinder 설치 완료 후 데이터베이스 접속 테스트를 하기 위한 방법 이며, 그 중에서 MariaDB/MySQL 데이터베이스에 접속 하는 방법을 자세하게 설명 하도록 하겠습니다. MariaDB/MySQL 데이터베이스에 접속 하기 위해서는 mysql-connector-java-5.1.39.jar를 lib 폴더에 반드시 적용 되어 있어야 합니다.
1. lib 폴더에 mysql-connector-java-5.1.39.jar 파일 업로드
- lib 폴더를 생성 한 후에 mysql-connector-java-5.1.39.jar 파일을 Update script or resources 버튼을 통해서 업로드
2. Script 화면
- MariaDBAccess.py : MariaDB/MySQL DBMS에 접속하는 스크립트 소스
- lib : 라이브러리 파일을 업로드 한 폴더
3. nGrinder MariaDB/MySQL Database Access(접속 테스트) 소스
- Create a script > Type : Jython
- DB_connect 접속하려는 IP, 포트, Database
- DB_user 사용자 ID
- DB_paassword :사용자 패스워드
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | # -*- coding:utf-8 -*- # mysql Database test. # from java.sql import DriverManager from com.mysql.jdbc import Driver from net.grinder.script.Grinder import grinder from net.grinder.script import Test from java.util import Random from java.lang import System # Parameters DB_user = "root" DB_password = "###PASSWORD###" test1 = Test( 1 , "Database select" ) random = Random( long (System.nanoTime())) # Load the JDBC driver. DriverManager.registerDriver(Driver()) def getConnection(): return DriverManager.getConnection(DB_connect, DB_user, DB_password) def ensureClosed( object ): try : object .close() except : pass class TestRunner: def __init__( self ): test1.record(TestRunner.__call__) grinder.statistics.delayReports = True pass def __call__( self ): connection = None selectStatement = None try : # in this test, we will create connection and statement in every test transaction. connection = getConnection() selectStatement = connection.createStatement() selectStatement.execute( "SELECT COUNT(*) AS CNT FROM EST_AGGR A" ) finally : ensureClosed(selectStatement) |
4. nGrinder MariaDB/MySQL Database Access 결과
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 2017 - 05 - 18 11 : 29 : 40 , 986 INFO The Grinder version 3.9 . 1 2017 - 05 - 18 11 : 29 : 41 , 024 INFO Java(TM) SE Runtime Environment 1.7 . 0_79 - b15: Java HotSpot(TM) 64 - Bit Server VM ( 24.79 - b02, mixed mode) on Linux amd64 3.10 . 0 - 327.el7 .x86_64 2017 - 05 - 18 11 : 29 : 41 , 027 INFO time zone is KST ( + 0900 ) 2017 - 05 - 18 11 : 29 : 41 , 211 INFO worker process 0 of agent number 0 2017 - 05 - 18 11 : 29 : 41 , 306 INFO Instrumentation agents: byte code transforming instrumenter for Jython 2.5 ; byte code transforming instrumenter for Java 2017 - 05 - 18 11 : 29 : 44 , 892 INFO Running "MariaDBAccess.py" using Jython 2.5 . 3 ( 2.5 :c56500f08d34 + , Aug 13 2012 , 14 : 54 : 35 ) [Java HotSpot(TM) 64 - Bit Server VM (Oracle Corporation)] 2017 - 05 - 18 11 : 29 : 45 , 021 INFO starting, will do 1 run 2017 - 05 - 18 11 : 29 : 45 , 022 INFO Start time is 1495074585022 ms since Epoch 2017 - 05 - 18 11 : 29 : 45 , 550 INFO finished 1 run 2017 - 05 - 18 11 : 29 : 45 , 552 INFO elapsed time is 530 ms 2017 - 05 - 18 11 : 29 : 45 , 553 INFO Final statistics for this process: 2017 - 05 - 18 11 : 29 : 45 , 561 INFO Tests Errors Mean Test Test Time TPS Time (ms) Standard Deviation (ms) Test 1 1 0 522.00 0.00 1.89 "Database select" Totals 1 0 522.00 0.00 1.89 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. 2017 - 05 - 18 11 : 29 : 44 , 932 INFO validation - 0 : Starting threads 2017 - 05 - 18 11 : 29 : 45 , 561 INFO validation - 0 : Finished |
'IT' 카테고리의 다른 글
[TIP][성능측정도구] NHN - nGrinder Oracle 접속 방법(Oracle, OJDBC) (0) | 2017.05.18 |
---|---|
[TIP][성능측정도구] NHN - nGrinder 설치 가이드 (2) | 2016.12.14 |
[TIP] Windows 7 시스템 성능 향상 시키기 - ReadyBoost 켜기 (0) | 2010.12.30 |
[TIP] 윈도우 용량 체크하는 프로그램(TreeSize) (0) | 2010.10.18 |
[TIP] MS Windows System Utils(Sysinternals Suite) - 시스템 유틸리티 (0) | 2010.07.06 |