|
|
@@ -21,7 +21,7 @@ class Worker
|
|
|
* workerman version
|
|
|
* @var string
|
|
|
*/
|
|
|
- const VERSION = '3.0.2';
|
|
|
+ const VERSION = '3.0.3';
|
|
|
|
|
|
/**
|
|
|
* status starting
|
|
|
@@ -920,7 +920,7 @@ class Worker
|
|
|
}
|
|
|
}
|
|
|
file_put_contents(self::$_statisticsFile, "---------------------------------------PROCESS STATUS-------------------------------------------\n", FILE_APPEND);
|
|
|
- file_put_contents(self::$_statisticsFile, "pid\tmemory ".str_pad('listening', self::$_maxSocketNameLength)." ".str_pad('worker_name', self::$_maxWorkerNameLength)." ".str_pad('total_request', 13)." ".str_pad('send_fail', 9)." ".str_pad('throw_exception', 15)."\n", FILE_APPEND);
|
|
|
+ file_put_contents(self::$_statisticsFile, "pid\tmemory ".str_pad('listening', self::$_maxSocketNameLength)." ".str_pad('worker_name', self::$_maxWorkerNameLength)." connection ".str_pad('total_request', 13)." ".str_pad('send_fail', 9)." ".str_pad('throw_exception', 15)."\n", FILE_APPEND);
|
|
|
|
|
|
chmod(self::$_statisticsFile, 0722);
|
|
|
|
|
|
@@ -934,7 +934,7 @@ class Worker
|
|
|
// for worker process
|
|
|
$worker = current(self::$_workers);
|
|
|
$wrker_status_str = posix_getpid()."\t".str_pad(round(memory_get_usage()/(1024*1024),2)."M", 7)." " .str_pad($worker->getSocketName(), self::$_maxSocketNameLength) ." ".str_pad(($worker->name == $worker->getSocketName() ? 'none' : $worker->name), self::$_maxWorkerNameLength)." ";
|
|
|
- $wrker_status_str .= str_pad(ConnectionInterface::$statistics['total_request'], 14)." ".str_pad(ConnectionInterface::$statistics['send_fail'],9)." ".str_pad(ConnectionInterface::$statistics['throw_exception'],15)."\n";
|
|
|
+ $wrker_status_str .= str_pad(ConnectionInterface::$statistics['connection_count'], 10)." ".str_pad(ConnectionInterface::$statistics['total_request'], 14)." ".str_pad(ConnectionInterface::$statistics['send_fail'],9)." ".str_pad(ConnectionInterface::$statistics['throw_exception'],15)."\n";
|
|
|
file_put_contents(self::$_statisticsFile, $wrker_status_str, FILE_APPEND);
|
|
|
}
|
|
|
|
|
|
@@ -1110,6 +1110,7 @@ class Worker
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
+ ConnectionInterface::$statistics['connection_count']++;
|
|
|
$connection = new TcpConnection($new_socket);
|
|
|
$connection->protocol = $this->_protocol;
|
|
|
$connection->onMessage = $this->onMessage;
|