配置php.ini中的
auto_prepend_file
auto_append_file
加入自动解析页面来获取执行时间

; Automatically add files before or after any PHP document.
auto_prepend_file = monitor_prog.php
auto_append_file = monitor_prog.php

把monitor_prog.php放到包含目录下。

monitor_prog.php

<? php
// print_r($_SERVER);
if  (  ! function_exists ( ' getmicrotime_t ' ) ) {
function  getmicrotime_t(){ 
    
list ( $usec ,   $sec =   explode ( "   " , microtime ()); 
    
return   $usec ;
    
// return ((float)$usec + (float)$sec); 
} // end func 
}
$time1   =   date ( ' Y-m-d H:i:s ' );
$usec   =  getmicrotime_t();
$usec   *=   1000
$time   =   $time1 . "   " . $usec ;


$phpself = $_SERVER [PHP_SELF];
$serverName = $_SERVER [SERVER_NAME];
$documentRoot = $_SERVER [DOCUMENT_ROOT];
$serverAdmin = $_SERVER [SERVER_ADMIN];

$str = $phpself . "  ;time= " . $time . "   ;serverName= " . $serverName . "  ;documentRoot= " . $documentRoot . "  ;email= " . $serverAdmin ;
$fp   =   fopen ( " d:/web/test/include/time.txt " , " ab " );
fwrite ( $fp ,   $str . " \r\n " );
fclose ( $fp );
// <PRE>
?>

等有了一些统计的数据后,写程序进行数据图表分析

相关文章:

  • 2021-12-22
  • 2021-07-11
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2021-11-26
猜你喜欢
  • 2021-10-02
  • 2022-12-23
  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2021-10-13
  • 2021-05-09
相关资源
相似解决方案