瀏覽代碼

统计模块支持windows多线程版本workerman

walkor 11 年之前
父節點
當前提交
b8248d33da

+ 2 - 2
applications/Statistics/Bootstrap/StatisticProvider.php

@@ -166,7 +166,7 @@ class StatisticProvider extends Man\Core\SocketWorker
                     {
                         continue;
                     }
-                    list($interface, $date) = explode("|", basename($file));
+                    list($interface, $date) = explode(".", basename($file));
                     $all_interface[$interface] = $interface;
                 }
                 $modules_name_array[$module] = $all_interface;
@@ -189,7 +189,7 @@ class StatisticProvider extends Man\Core\SocketWorker
             return '';
         }
         // log文件
-        $log_file = WORKERMAN_LOG_DIR . $this->statisticDir."{$module}/{$interface}|{$date}";
+        $log_file = WORKERMAN_LOG_DIR . $this->statisticDir."{$module}/{$interface}.{$date}";
         
         $handle = @fopen($log_file, 'r');
         if(!$handle)

+ 1 - 1
applications/Statistics/Bootstrap/StatisticWorker.php

@@ -167,7 +167,7 @@ class StatisticWorker extends Man\Core\SocketWorker
                // 依次写入磁盘
                foreach($items as $interface=>$data)
                {
-                   file_put_contents($file_dir. "/{$interface}|".date('Y-m-d'), "$ip\t$time\t{$data['suc_count']}\t{$data['suc_cost_time']}\t{$data['fail_count']}\t{$data['fail_cost_time']}\t".json_encode($data['code'])."\n", FILE_APPEND | LOCK_EX);
+                   file_put_contents($file_dir. "/{$interface}.".date('Y-m-d'), "$ip\t$time\t{$data['suc_count']}\t{$data['suc_cost_time']}\t{$data['fail_count']}\t{$data['fail_cost_time']}\t".json_encode($data['code'])."\n", FILE_APPEND | LOCK_EX);
                }
            }
        }