original_string: 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";
          }
      }
code: 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";
          }
      }
code_tokens: 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" ; } }
docstring: Return the query type.
  
  @param \CachetHQ\Cachet\Models\Metric $metric
  
  @return string
docstring_tokens: Return the query type .