public function enableStatistics($enable = true, $sortBy = 'averageTime')
    {
        if (!\in_array($sortBy, ['count', 'deltaTime', 'averageTime'], true)) {
            throw new \InvalidArgumentException("Cannot sort statistics by '$sortBy' column.");
        }

        $this->performStatistics = (bool) $enable;
        $this->sortBy = $sortBy;

        return $this;
    }