Background Image
응용개발
2009.07.01 00:39

PHP PEAR extension 을 이용한 DB Time 추적

조회 수 19182 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

홈페이지 http://pear.php.net/package/Benchmark
PEAR란?
PHP Extension and Application Repository를 뜻한다.

설치된 PEAR 목록
[test@d85009 bin]$ ./pear list
Installed packages, channel pear.php.net:
=========================================
Package          Version State
Archive_Tar      1.3.2   stable
Benchmark        1.2.7   stable
Cache_Lite       1.7.7   stable
Console_Getopt   1.2.3   stable
PEAR             1.7.2   stable
Structures_Graph 1.0.2   stable
apd              1.0.1   stable

Benchmark 인스톨
[test@d85009 bin]$pear install Benchmark
Benchmark 업그래이드
[test@d85009 bin]$pear upgrade Benchmark

예제코드) require_once 'Benchmark/Timer.php'; $timer = new Benchmark_Timer(); $timer->start(); // connect to the server $db->connect(); $timer->setMarker('connection'); $sql = "SELECT COUNT(*) cnt FROM bbs where module_srl = 60 " ; // feed it the sql directly. it will return all records $all_rows = $db->fetch_all_array($sql); foreach($all_rows as $key=>$val){ $row_cnt = $val[cnt]; } $timer->setMarker('sql1-execute-fetch'); $db->close(); $timer->stop(); $timer->display(); // to output html formated
time index ex time %
Start 1246342988.69640600 - 0.00%
connection 1246342988.69703800 0.000632 3.45%
sql1execute-fetch 1246342988.71429800 0.017260 94.26%
Stop 1246342988.71471800 0.000420 2.29%
total - 0.018312 100.00%

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
16 응용개발 CUBRID R3.0부터 JDBC를 사용하는 응용에서 charset 설정 방법이 변경되었네요. 손승일 2010.12.02 19635
15 응용개발 CUBRID에서 SQL힌트와 주석을 쓸 때 순서. cubebridge 2012.01.11 13324
14 응용개발 Weblogic 10.0 사용시 JDK 1.5를 사용한 JDBC 드라이버 사용시 주의사항. cubebridge 2012.02.22 51957
13 응용개발 utf-8로 저장된 한글이 JAVA SP를 사용하여 읽어 오면 깨져 보일때 손승일 2012.03.10 20799
12 응용개발 오라클 to CUBRID로 마이그레이션 수행 시 주의사항 cubebridge 2012.11.12 16642
11 응용개발 CUBRID-PHP-Driver 연동가이드 file cubebridge 2012.11.13 17136
10 응용개발 전체 레코드 개수 확인하는 SP 김승훈 2015.05.07 14728
9 응용개발 JAVA SP 사용 시 로그 처리 방법 손승일 2015.06.03 8574
8 응용개발 WHERE 조건에서 다중 컬럼 IN절 처리 최적화 방법 (cubrid + ibatis) 1 이상신 2015.08.21 55135
7 응용개발 maven에서 CUBRID JDBC Driver 추가하기 file 김승훈 2015.12.09 8944
6 응용개발 CUBRID HA 제약 사항 및 확인 방법 손승일 2015.12.29 5305
5 응용개발 CUBRID DB에서 critical section 정보 출력하기 file 주현 2015.12.31 4590
4 응용개발 Windows에서 32bit 버전의 PHP 설치 후 CUBRID와 연동 실패 시 해결 방법 file 진우진 2016.03.28 4523
3 응용개발 Windows 환경에서 JAVA SP 사용 utf-8 한글 깨짐 해결 file 손승일 2016.07.01 4592
2 응용개발 CUBRID 와 DBCP의 관계 엄기호 2016.12.14 2795
1 응용개발 CUBRID PHP 드라이버 빌드와 연동방법 정만영 2018.03.07 3764
Board Pagination Prev 1 2 3 Next
/ 3

Contact Cubrid

대표전화 070-4077-2110 / 기술문의 070-4077-2113 / 영업문의 070-4077-2112 / Email. contact_at_cubrid.com
Contact Sales