for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types=1);
namespace Igni\Http\Server;
/**
* Value class that aggregates server's statistics.
*
* @package Igni\Http\Server
*/
class ServerStats
{
private $stats;
* ServerStats constructor.
* @param array $stats
public function __construct(array $stats)
$this->stats = $stats;
}
* Returns the timestamp of server since start
* @return int
public function getStartTime(): int
return $this->stats['start_time'];
* Returns the number of current connections
public function getConnections(): int
return $this->stats['connection_num'];
* Returns the number of accepted connections
public function getAcceptedConnections(): int
return $this->stats['accept_count'];
* Returns the number of closed connections
public function getClosedConnections(): int
return $this->stats['close_count'];
* Returns the number of queuing up tasks
public function getAwaitingConnections(): int
* Returns the number of received requests
public function getReceivedRequests(): int
return $this->stats['request_count'];