original_string: public function aggregateNumericMetrics($columns, $operationToApply = false)
      {
          $metrics = $this->getAggregatedNumericMetrics($columns, $operationToApply);
  
          foreach ($metrics as $column => $value) {
              $value = Common::forceDotAsSeparatorForDecimalPoint($value);
              $this->archiveWriter->insertRecord($column, $value);
          }
          // if asked for only one field to sum
          if (count($metrics) == 1) {
              return reset($metrics);
          }
  
          // returns the array of records once summed
          return $metrics;
      }
code: public function aggregateNumericMetrics($columns, $operationToApply = false)
      {
          $metrics = $this->getAggregatedNumericMetrics($columns, $operationToApply);
  
          foreach ($metrics as $column => $value) {
              $value = Common::forceDotAsSeparatorForDecimalPoint($value);
              $this->archiveWriter->insertRecord($column, $value);
          }
          // if asked for only one field to sum
          if (count($metrics) == 1) {
              return reset($metrics);
          }
  
          // returns the array of records once summed
          return $metrics;
      }
code_tokens: public function aggregateNumericMetrics ( $ columns , $ operationToApply = false ) { $ metrics = $ this -> getAggregatedNumericMetrics ( $ columns , $ operationToApply ) ; foreach ( $ metrics as $ column => $ value ) { $ value = Common :: forceDotAsSeparatorForDecimalPoint ( $ value ) ; $ this -> archiveWriter -> insertRecord ( $ column , $ value ) ; } // if asked for only one field to sum if ( count ( $ metrics ) == 1 ) { return reset ( $ metrics ) ; } // returns the array of records once summed return $ metrics ; }
docstring: Aggregates one or more metrics for every subperiod of the current period and inserts the results
  as metrics for the current period.
  
  @param array|string $columns Array of metric names to aggregate.
  @param bool|string $operationToApply The operation to apply to the metric. Either `'sum'`, `'max'` or `'min'`.
  @return array|int Returns the array of aggregate values. If only one metric was aggregated,
  the aggregate value will be returned as is, not in an array.
  For example, if `array('nb_visits', 'nb_hits')` is supplied for `$columns`,
  
  array(
  'nb_visits' => 3040,
  'nb_hits' => 405
  )
  
  could be returned. If `array('nb_visits')` or `'nb_visits'` is used for `$columns`,
  then `3040` would be returned.
  @api
docstring_tokens: Aggregates one or more metrics for every subperiod of the current period and inserts the results as metrics for the current period .