private function parseMetrics(\DOMXPath $xpath, \DOMNode $rootNode)
    {
        $metrics = [];

        foreach ($xpath->query(self::METRICS_PATH, $rootNode) as $metricNode) {
            $metric = [];
            foreach ($metricNode->attributes as $attribute) {
                $metric[$attribute->name] = $attribute->value;
            }
            $metrics[$metric['name']] = $metric;
        }

        return $metrics;
    }