/** * @test * @dataProvider performanceDataProvider * @param $colCount * @param $rowCount */ public function iterationListDataPerformance($colCount, $rowCount) { $listSettings = $this->getExtListTypoScript(); $memoryBefore = memory_get_usage(true); $timeBefore = microtime(true); // TODO we are calling a static method on an object here... make this non-static and remove static methods from extlist context factory! Tx_PtExtlist_ExtlistContext_ExtlistContextFactory::setExtListTyposSript($listSettings); $extListContext = Tx_PtExtlist_ExtlistContext_ExtlistContextFactory::getContextByListIdentifier('performanceTestList'); $extListContext->getDataBackend()->setColCount($colCount)->setRowCount($rowCount); $iterationListData = $extListContext->getDataBackend()->getIterationListData(); $iterationListData->current(); /** * This loop renders the complete data set */ foreach ($iterationListData as $row) { /** @var $row Tx_PtExtlist_Domain_Model_List_Row */ } $usedMemory = memory_get_usage(true) - $memoryBefore; $readableMemoryUsage = $usedMemory / (1024 * 1024); $readableMemoryPeakUsage = memory_get_peak_usage(true) / (1024 * 1024); $usedMicroseconds = microtime(true) - $timeBefore; $info = sprintf("\n\t\t\tMemory Usage: %s MB <br />\n\t\t\tMemory Peak Usage %s MB <br />\n\t\t\tProcessing Time: %s Mircroseconds.", $readableMemoryUsage, $readableMemoryPeakUsage, $usedMicroseconds); //die($info); $this->assertTrue(true); }
/** * @return void */ protected function renderFilterStates() { $activeSheet = $this->objPHPExcel->getActiveSheet(); $extlistContext = Tx_PtExtlist_ExtlistContext_ExtlistContextFactory::getContextByListIdentifier($this->exportConfiguration->getListIdentifier()); $filterBoxCollection = $extlistContext->getFilterBoxCollection(); $activeSheet->setCellValueByColumnAndRow(0, $this->rowNumber, 'Filter'); $this->activeSheet->getStyleByColumnAndRow(0, $this->rowNumber)->applyFromArray(array('font' => array('bold' => true))); $this->rowNumber++; foreach ($filterBoxCollection as $filterBox) { /** @var $filterBox Tx_PtExtlist_Domain_Model_Filter_Filterbox */ foreach ($filterBox as $filter) { /** @var $filter Tx_PtExtlist_Domain_Model_Filter_AbstractFilter */ $activeSheet->setCellValueByColumnAndRow(0, $this->rowNumber, $extlistContext->getConfigurationBuilder()->buildFilterConfiguration()->getFilterBoxConfig($filter->getFilterConfig()->getFilterboxIdentifier())->getFilterConfigByFilterIdentifier($filter->getFilterConfig()->getFilterIdentifier())->getLabel()); $activeSheet->setCellValueByColumnAndRow(1, $this->rowNumber++, $this->renderFilterValues($filter)); } } $activeSheet->setCellValueByColumnAndRow(0, $this->rowNumber++, ''); }