Changeset 18990
- Timestamp:
- 2010/11/06 20:27:45 (13 years ago)
- Location:
- branches/camp/camp-2_5-D
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/camp/camp-2_5-D/data/class/SC_Query.php
r18980 r18990 775 775 */ 776 776 function execute(&$sth, $arrVal = array()) { 777 $timeStart = SC_Utils_Ex::sfMicrotimeFloat(); 777 778 $affected =& $sth->execute($arrVal); 779 780 // 一定以上時間かかったSQLの場合、ログ出力する。 781 if(defined('SQL_QUERY_LOG_MODE') && SQL_QUERY_LOG_MODE == true) { 782 $timeEnd = SC_Utils_Ex::sfMicrotimeFloat();; 783 $timeExecTime = $timeEnd - $timeStart; 784 if(defined('SQL_QUERY_LOG_MIN_EXEC_TIME') && $timeExecTime >= (float)SQL_QUERY_LOG_MIN_EXEC_TIME) { 785 //$logMsg = sprintf("SQL_LOG [%.2fsec]\n%s", $timeExecTime, $this->getLastQuery(false)); 786 $logMsg = sprintf("SQL_LOG [%.2fsec]\n%s", $timeExecTime, $sth->query); 787 GC_Utils_Ex::gfPrintLog($logMsg); 788 } 789 } 790 778 791 if (PEAR::isError($affected)) { 779 792 $sql = isset($sth->query) ? $sth->query : ''; -
branches/camp/camp-2_5-D/data/class/pages/LC_Page.php
r18701 r18990 82 82 */ 83 83 function init() { 84 // 開始時刻を設定する。 85 $this->timeStart = SC_Utils_Ex::sfMicrotimeFloat(); 86 84 87 $this->tpl_authority = $_SESSION['authority']; 85 88 // XXX すべてのページで宣言するべき … … 100 103 * @return void 101 104 */ 102 function destroy() {} 105 function destroy() { 106 // 一定時間以上かかったページの場合、ログ出力する。 107 if(defined('PAGE_DISPLAY_TIME_LOG_MODE') && PAGE_DISPLAY_TIME_LOG_MODE == true) { 108 $timeEnd = SC_Utils_Ex::sfMicrotimeFloat();; 109 $timeExecTime = $timeEnd - $this->timeStart; 110 if(defined('PAGE_DISPLAY_TIME_LOG_MIN_EXEC_TIME') && $timeExecTime >= (float)PAGE_DISPLAY_TIME_LOG_MIN_EXEC_TIME) { 111 $logMsg = sprintf("PAGE_DISPLAY_TIME_LOG [%.2fsec]", $timeExecTime); 112 GC_Utils_Ex::gfPrintLog($logMsg); 113 } 114 } 115 116 } 103 117 104 118 /** -
branches/camp/camp-2_5-D/html/install/sql/insert_data.sql
r18882 r18990 1080 1080 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PRODUCT_TYPE_NORMAL', '1', 900, '通常商品'); 1081 1081 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PRODUCT_TYPE_DOWNLOAD', '2', 901, 'ダウンロード商品'); 1082 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('SQL_QUERY_LOG_MODE', '1', 902, 'SQLログを取得するフラグ(1:表示, 0:非表示)'); 1083 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('SQL_QUERY_LOG_MIN_EXEC_TIME', '2', 903, 'SQLログを取得する時間設定(設定値以上かかった場合に取得)'); 1084 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PAGE_DISPLAY_TIME_LOG_MODE', '1', 904, 'ページ表示時間のログを取得するフラグ(1:表示, 0:非表示)'); 1085 INSERT INTO mtb_constants (id, name, rank, remarks) VALUES ('PAGE_DISPLAY_TIME_LOG_MIN_EXEC_TIME', '2', 905, 'ページ表示時間のログを取得する時間設定(設定値以上かかった場合に取得)'); 1086
Note: See TracChangeset
for help on using the changeset viewer.