hasColumn('nb_hits_with_bandwidth')) { $hits = $this->getMetricAsIntSafe($row, 'nb_hits_with_bandwidth'); } else { $hits = $this->getMetricAsIntSafe($row, Metrics::METRICS_NB_HITS_WITH_BANDWIDTH); } if ($row->hasColumn('sum_bandwidth')) { $sum = $this->getMetricAsIntSafe($row, 'sum_bandwidth'); } else { $sum = $this->getMetricAsIntSafe($row, Metrics::METRICS_PAGE_SUM_BANDWIDTH); } if (!empty($hits) && !empty($sum)) { $avg = floor($sum / $hits); } else { $avg = 0; } return (int)$avg; } public function getDependentMetrics() { return ['nb_hits_with_bandwidth', 'sum_bandwidth']; } public function getSemanticType(): ?string { return Dimension::TYPE_NUMBER; } }