Prechádzať zdrojové kódy

Merge pull request #555 from visuddhinanda/master

添加性能log
visuddhinanda 4 rokov pred
rodič
commit
0e5c943042

+ 14 - 0
app/log/pref_log.php

@@ -0,0 +1,14 @@
+<?php
+require_once("../path.php");
+$logstart = microtime(true)*1000;
+$strstart = date("h:i:sa");
+function PrefLog(){
+	$file = fopen(_DIR_LOG_."/pref_".date("Y-m-d").".log","a");
+	if($file){
+		fputcsv($file,[$_SERVER['PHP_SELF'],$GLOBALS['strstart'],sprintf("%d",microtime(true)*1000-$GLOBALS['logstart']),$_SERVER['REMOTE_ADDR']]);
+		fclose($file);
+	}
+}
+
+
+?>

+ 2 - 0
app/studio/dict_find_auto.php

@@ -1,4 +1,5 @@
 <?php
+include("../log/pref_log.php");
 require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once "../public/function.php";
@@ -515,3 +516,4 @@ if ($debug) {
     $queryTime = (microtime_float() - $time_start) * 1000;
     echo "<div >搜索时间:$queryTime 毫秒</div>";
 }
+PrefLog();

+ 4 - 1
app/studio/dict_find_one.php

@@ -1,4 +1,5 @@
 <?php
+include("../log/pref_log.php");
 require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once "../public/function.php";
@@ -235,7 +236,6 @@ for ($i = 0; $i < $lookup_loop; $i++) {
 
 		
 
-        //$Fetch = PDO_FetchAll($query);
         $iFetch = count($Fetch);
         if ($debug) {
             echo "count:$iFetch<br>";
@@ -409,3 +409,6 @@ if ($debug) {
     $queryTime = (microtime_float() - $time_start) * 1000;
     echo "<div >搜索时间:$queryTime 毫秒</div>";
 }
+
+
+PrefLog();

+ 1 - 1
app/term/term.css

@@ -300,7 +300,7 @@ note > .tran .tran_text_tool_bar::after,
 
 note > .palitext,
 .palitext {
-	line-height: 1.5em;
+	line-height: 2em;
 	color: #9f3a01;
 	margin: 4px;
 }

+ 2 - 1
app/uwbw/create_wbw.php

@@ -1,6 +1,7 @@
 <?php
 //工程文件操作
 //建立,
+include("../log/pref_log.php");
 require_once '../path.php';
 require_once "../public/_pdo.php";
 require_once "../public/function.php";
@@ -271,5 +272,5 @@ foreach ($_para as $key => $para) {
 
 */
 echo json_encode($output, JSON_UNESCAPED_UNICODE);
-
+PrefLog();
 ?>

+ 3 - 0
app/uwbw/update.php

@@ -2,6 +2,7 @@
 /*
 get xml doc from db
  */
+include("../log/pref_log.php");
 require_once "../path.php";
 require_once "../public/_pdo.php";
 require_once "../public/function.php";
@@ -113,3 +114,5 @@ if (count($aData) > 0) {
     $respond['message'] = "no data";
     echo json_encode($respond, JSON_UNESCAPED_UNICODE);
 }
+
+PrefLog();