private function collectData(
        string $token,
        ServerRequestInterface $serverRequest,
        ResponseInterface $response
    ): void {
        // sort on priority
        \usort($this->collectors, static function ($a, $b) {
            return $a['priority'] <=> $b['priority'];
        });

        foreach ($this->collectors as $name => $collector) {
            $collector['collector']->collect($serverRequest, $response);

            $this->collectors[$name]['collector'] = $collector['collector'];
        }

        $ip = (new ClientIp($serverRequest))->getIpAddress();

        if ($this->cachePool !== null) {
            $this->createProfile(
                $token,
                $ip ?? 'Unknown',
                $serverRequest->getMethod(),
                (string) $serverRequest->getUri(),
                $response->getStatusCode(),
                \microtime(true),
                \date('Y-m-d H:i:s'),
                $this->collectors
            );
        }
    }