protected function setRequestMetrics($request, array $handler)
    {
        if (empty($handler['query']['metrics'])) {
            throw new OutOfRangeException('No query metrics data found in the handler');
        }

        $metrics = array();

        foreach ((array) $handler['query']['metrics'] as $i => $name) {
            $metric = new \Google_Service_AnalyticsReporting_Metric;
            $metric->setExpression($name);
            $metrics[] = $metric;
        }

        $request->setMetrics($metrics);
    }