protected function getQueryType(Metric $metric)
    {
        if (!isset($metric->calc_type) || $metric->calc_type == Metric::CALC_SUM) {
            return "sum({$this->getMetricPointsTable()}.value * {$this->getMetricPointsTable()}.counter) AS value";
        } elseif ($metric->calc_type == Metric::CALC_AVG) {
            return "avg({$this->getMetricPointsTable()}.value) AS value";
        } else {
            return "sum({$this->getMetricPointsTable()}.value * {$this->getMetricPointsTable()}.counter) AS value";
        }
    }