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%

  1. JAVA SP를 통해 다른 데이터베이스 연결하는 경우 잊지 말자.

  2. JDBC 사용시 SQL 로깅 - p6spy 사용

  3. JDBC 커넥션 스트링에 UTF-8 명시하는법

  4. Java Data Type의 CUBRID Data Type으로의 변경 Tip

  5. MySQL의 Blob타입을 CUBRID로 변환하기

  6. ODBC 드라이버를 이용한 Prepare 사용하기.

  7. PHP PEAR extension Cache-Lite 를 이용한 응용 프로그램 최적화

  8. PHP PEAR extension 을 이용한 DB Time 추적

  9. PHP 성능 최적화를 위한 고려 사항

  10. PHP 프로그램을 작성할때 주의할 점

  11. PHP에 CUBRID 모듈 추가시 모듈이 로드되지 않는 문제에 대한 해결 방안 하나입니다

  12. PHP에서 Prepared statement 사용시 NULL 값을 바인딩 하는 방법

  13. PHP에서 prepared statement 사용시 BIND 관련 팁

  14. PHP에서 prepared statement 사용하기

  15. WHERE 조건에서 다중 컬럼 IN절 처리 최적화 방법 (cubrid + ibatis)

  16. Weblogic 10.0 사용시 JDK 1.5를 사용한 JDBC 드라이버 사용시 주의사항.

  17. Windows 환경에서 JAVA SP 사용 utf-8 한글 깨짐 해결

  18. Windows에서 32bit 버전의 PHP 설치 후 CUBRID와 연동 실패 시 해결 방법

  19. cubrid-php module r2.2 이상 버젼에서 configure시에 주의사항

  20. cubrid_fetch_all() php 함수로 만들어 사용하기

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