Jyxo\Rpc\Client::profileEnd PHP Method

profileEnd() protected method

Finishes profiling.
protected profileEnd ( string $type, string $method, array $params, mixed $response ) : self
$type string Request type
$method string Method name
$params array Method parameters
$response mixed Server response
return self
    protected function profileEnd(string $type, string $method, array $params, $response) : self
    {
        // Profiling has to be turned on
        if ($this->profiler) {
            static $totalTime = 0;
            static $requests = [];
            // Get elapsed time
            $time = \Jyxo\Timer::stop($this->timer);
            $totalTime += $time;
            $requests[] = [strtoupper($type), (string) $method, $params, $response, sprintf('%0.3f', $time * 1000)];
            // Send to FirePHP
            \Jyxo\FirePhp::table(sprintf('Jyxo RPC Profiler (%d requests took %0.3f ms)', count($requests), sprintf('%0.3f', $totalTime * 1000)), ['Type', 'Method', 'Request', 'Response', 'Time'], $requests, 'Rpc');
        }
        return $this;
    }