getDataTableFromNumeric($columns); $precision = 2; $dataTable->filter('ColumnCallbackReplace', [[ Archiver::PAGEPERFORMANCE_TOTAL_NETWORK_TIME, Archiver::PAGEPERFORMANCE_TOTAL_SERVER_TIME, Archiver::PAGEPERFORMANCE_TOTAL_TRANSFER_TIME, Archiver::PAGEPERFORMANCE_TOTAL_DOMPROCESSING_TIME, Archiver::PAGEPERFORMANCE_TOTAL_DOMCOMPLETION_TIME, Archiver::PAGEPERFORMANCE_TOTAL_ONLOAD_TIME, Archiver::PAGEPERFORMANCE_TOTAL_PAGE_LOAD_TIME, ], function($value) { return $value / 1000; }]); $dataTable->filter('ColumnCallbackAddColumnQuotient', array( $this->getMetricColumn(AverageTimeNetwork::class), Archiver::PAGEPERFORMANCE_TOTAL_NETWORK_TIME, Archiver::PAGEPERFORMANCE_TOTAL_NETWORK_HITS, $precision )); $dataTable->filter('ColumnCallbackAddColumnQuotient', array( $this->getMetricColumn(AverageTimeServer::class), Archiver::PAGEPERFORMANCE_TOTAL_SERVER_TIME, Archiver::PAGEPERFORMANCE_TOTAL_SERVER_HITS, $precision )); $dataTable->filter('ColumnCallbackAddColumnQuotient', array( $this->getMetricColumn(AverageTimeTransfer::class), Archiver::PAGEPERFORMANCE_TOTAL_TRANSFER_TIME, Archiver::PAGEPERFORMANCE_TOTAL_TRANSFER_HITS, $precision )); $dataTable->filter('ColumnCallbackAddColumnQuotient', array( $this->getMetricColumn(AverageTimeDomProcessing::class), Archiver::PAGEPERFORMANCE_TOTAL_DOMPROCESSING_TIME, Archiver::PAGEPERFORMANCE_TOTAL_DOMPROCESSING_HITS, $precision )); $dataTable->filter('ColumnCallbackAddColumnQuotient', array( $this->getMetricColumn(AverageTimeDomCompletion::class), Archiver::PAGEPERFORMANCE_TOTAL_DOMCOMPLETION_TIME, Archiver::PAGEPERFORMANCE_TOTAL_DOMCOMPLETION_HITS, $precision )); $dataTable->filter('ColumnCallbackAddColumnQuotient', array( $this->getMetricColumn(AverageTimeOnLoad::class), Archiver::PAGEPERFORMANCE_TOTAL_ONLOAD_TIME, Archiver::PAGEPERFORMANCE_TOTAL_ONLOAD_HITS, $precision )); $dataTable->filter('ColumnCallbackAddColumnQuotient', array( $this->getMetricColumn(AveragePageLoadTime::class), Archiver::PAGEPERFORMANCE_TOTAL_PAGE_LOAD_TIME, Archiver::PAGEPERFORMANCE_TOTAL_PAGE_LOAD_HITS, $precision )); $dataTable->queueFilter('ColumnDelete', array($columns)); return $dataTable; } /** * @param string $class * @return string */ private function getMetricColumn($class) { /** @var ProcessedMetric $metric */ $metric = new $class(); return $metric->getName(); } }