Renders cache statistics.

@return string
176387
private function renderPanelCacheStatistics(): string
	{
		if (empty($this->entityManager)) {
			return '';
		}

		$config = $this->entityManager->getConfiguration();
		if (!$config->isSecondLevelCacheEnabled()) {
			return '';
		}

		$loggerChain = $config->getSecondLevelCacheConfiguration()->getCacheLogger();

		if (!$loggerChain instanceof Doctrine\ORM\Cache\Logging\CacheLoggerChain) {
			return '';
		}

		if (!$statistics = $loggerChain->getLogger('statistics')) {
			return '';
		}

		return Dumper::toHtml($statistics, [Dumper::DEPTH => 5]);
	}
731512
public function render()
    {
        $result = "";
        $params = [];
        $params['Host'] = $this->host;
        $siteMap = $this->sitemap;
        if (is_array($siteMap)) {
            $siteMap = Url::to($siteMap, true);
        }

        $params['Sitemap'] = $siteMap;
        foreach (array_filter($params) as $key => $value) {
            $result .= "$key: $value\n";
        }
        foreach ($this->userAgent as $userAgent => $value) {
            $result .= "User-agent: $userAgent\n";
            foreach ($value as $param => $urls) {
                if (is_string($urls)) {
                    $urls = [$urls];
                }

                $isWithScheme = false;
                if ($param == 'Sitemap') {
                    $urls = [$urls];
                    $isWithScheme = true;
                }

                foreach ($urls as $url) {
                    if (is_array($url)) {
                        $url = Url::to($url, $isWithScheme);
                    }

                    $result .= "$param: $url\n";
                }
            }
        }
        return $result;

    }
1811
public function render(ProjectStatistics $statistics)
    {
        $table = new Table($this->output);

        $table
            ->setHeaders(['Name', 'Classes', 'Methods', 'Methods/Class', 'Lines', 'LoC', 'LoC/Method'])
            ->setRows($statistics->components())
            ->addRow($statistics->other())
            ->addRow(new TableSeparator)
            ->addRow($statistics->total());

        for ($i = 1; $i <= 6; $i++) {
            $table->setColumnStyle($i, (new TableStyle)->setPadType(STR_PAD_LEFT));
        }

        $table->render();

        $metaData = array_merge(
            (new CodeTestRatio($statistics))->summary(),
            ['Number of Routes: '.app(NumberOfRoutes::class)->get()]
        );

        $this->output->text(
            implode('    ', $metaData)
        );
    }
94960
public function renderWhere()
	{
		$sResult = '(';
		$nCount = count($this->aCriteria);
		foreach($this->aCriteria as $n => $itm){
			$sResult .= $itm->renderWhere();
			if ($n != ($nCount - 1)) {
				$sResult .= ' '.$this->sType.' ';
			}
		}
		$sResult .= ')';
		return $sResult;
	}
978065
public function getCachedContent()
    {
        if ($this->_content !== null) {
            return $this->_content;
        }

        $this->_content = false;

        if (!($this->cache instanceof CacheInterface)) {
            return $this->_content;
        }

        $key = $this->calculateKey();
        $data = $this->cache->get($key);
        if (!is_array($data) || count($data) !== 2) {
            return $this->_content;
        }

        [$this->_content, $placeholders] = $data;
        if (!is_array($placeholders) || count($placeholders) === 0) {
            return $this->_content;
        }

        $this->_content = $this->updateDynamicContent($this->_content, $placeholders, true);

        return $this->_content;
    }
1113099
public function render()
    {
        $counter = 0;

        foreach ($this->getRoutes() as $name => $route) {
            if ('_' !== substr($name, 0, 1)) {
                $this->routeRenderer->render($route, $name);
                $counter += 1;
            }
        }

        return $counter;
    }
1009749
protected function renderContent() {    
        if($this->data->get('has_stats', false)) {
            $html = I18N::translate('%1$s visits since the beginning of %2$s<br>(%3$s today)' ,
                '<span class="odometer">' . I18N::number($this->data->get('visits_year')) . '</span>',
                date('Y'),
                '<span class="odometer">' . I18N::number($this->data->get('visits_today')) . '</span>'
                );
        }
        else {
            $html = I18N::translate('No statistics could be retrieved from Piwik.');
        }
        
        return $html;
    }
970228
public function getStats(): DriverStatistic
    {
        $stat = new DriverStatistic();
        $path = $this->getFilePath(false);

        if (!\is_dir($path)) {
            throw new PhpfastcacheIOException("Can't read PATH:" . $path);
        }

        $stat->setData(\implode(', ', \array_keys($this->itemInstances)))
            ->setRawData([
                'tmp' => $this->tmp,
            ])
            ->setSize(Directory::dirSize($path))
            ->setInfo('Number of files used to build the cache: ' . Directory::getFileCount($path));

        return $stat;
    }
665979
public function renderIndexTableInformation()
    {
        $table = 'tx_kesearch_index';

        // get table status
        $databaseConnection = Db::getDatabaseConnection($table);
        $tableStatusQuery = 'SHOW TABLE STATUS';
        $tableStatusRows = $databaseConnection->fetchAll($tableStatusQuery);
        $content = '';

        foreach ($tableStatusRows as $row) {
            if ($row['Name'] == $table) {
                $dataLength = $this->formatFilesize($row['Data_length']);
                $indexLength = $this->formatFilesize($row['Index_length']);
                $completeLength = $this->formatFilesize($row['Data_length'] + $row['Index_length']);

                $content .= '
					<table class="statistics">
						<tr>
							<td class="infolabel">Records: </td>
							<td>' . $row['Rows'] . '</td>
						</tr>
						<tr>
							<td class="infolabel">Data size: </td>
							<td>' . $dataLength . '</td>
						</tr>
						<tr>
							<td class="infolabel">Index size: </td>
							<td>' . $indexLength . '</td>
						</tr>
						<tr>
							<td class="infolabel">Complete table size: </td>
							<td>' . $completeLength . '</td>
						</tr>';
            }
        }

        $results_per_type = $this->getNumberOfRecordsInIndexPerType();
        if (count($results_per_type)) {
            foreach ($results_per_type as $type => $count) {
                $content .= '<tr><td>' . $type . '</td><td>' . $count . '</td></tr>';
            }
        }
        $content .= '</table>';

        return $content;
    }
630787
public function render()
    {
        $max_label_length = $this->max_label_length + 5;
        $dashes = str_repeat('-', $max_label_length + 39) . "\n";
        $margin = str_repeat(' ', 2);

        $header = sprintf(
            "%s %-{$max_label_length}s %-12s %-12s %s\n",
            $margin, 'label', 'time (ms)', 'perc', 'memory'
        );

        $body = '';
        foreach ($this->runs as $run) {
            $body .= sprintf(
                "%s %-{$max_label_length}s %-10s %6s %14s\n",
                $margin,
                $run->label,
                $run->time,
                number_format(($run->time * 100) / $this->total, 2, '.', ''),
                $run->memory
            );
        }
        return $header . $dashes . $body . $dashes;
    }
1071018
public function stats()
    {
        $counters = $this->initStats();

        foreach ($this->groupBy('level') as $level => $entries) {
            $counters[$level] = $count = count($entries);
            $counters['all'] += $count;
        }

        return $counters;
    }
1115088
public function renderSummary()
	{
		if(($count=$this->dataProvider->getItemCount())<=0)
			return;

		echo CHtml::openTag($this->summaryTagName, array('class'=>$this->summaryCssClass));
		if($this->enablePagination)
		{
			$pagination=$this->dataProvider->getPagination();
			$total=$this->dataProvider->getTotalItemCount();
			$start=$pagination->currentPage*$pagination->pageSize+1;
			$end=$start+$count-1;
			if($end>$total)
			{
				$end=$total;
				$start=$end-$count+1;
			}
			if(($summaryText=$this->summaryText)===null)
				$summaryText=Yii::t('zii','Displaying {start}-{end} of 1 result.|Displaying {start}-{end} of {count} results.',$total);
			echo strtr($summaryText,array(
				'{start}'=>$start,
				'{end}'=>$end,
				'{count}'=>$total,
				'{page}'=>$pagination->currentPage+1,
				'{pages}'=>$pagination->pageCount,
			));
		}
		else
		{
			if(($summaryText=$this->summaryText)===null)
				$summaryText=Yii::t('zii','Total 1 result.|Total {count} results.',$count);
			echo strtr($summaryText,array(
				'{count}'=>$count,
				'{start}'=>1,
				'{end}'=>$count,
				'{page}'=>1,
				'{pages}'=>1,
			));
		}
		echo CHtml::closeTag($this->summaryTagName);
	}
1348242
public function getTemplate()
    {
        if (!$this->useCaching()) {
            $result = $this->renderTemplate();
        } else {
            $cache = Injector::inst()->get(CacheInterface::class . '.PageSlices');
            if (!$cache->has($this->getCacheKey())) {
                $result = $this->renderTemplate();
                $cache->set($this->getCacheKey(), $result);
            } else {
                $result = $cache->get($this->getCacheKey());
            }
        }

        return $result;
    }
1130228
public function render($caching = false, $params = array())
	{
		$this->_caching = $caching;

		if (!empty($this->_template))
		{
			$data = $this->_renderTemplate();
		}
		else
		{
			$this->parse($params);
			$data = $this->_renderTemplate();
		}

		parent::render();
		return $data;
	}
578537
public function getCacheHits()
    {
        return array_reduce(iterator_to_array($this->getCommands()), function ($hits, $value) {
            $hits += $value['cache'];

            return $hits;
        });
    }
1261778
public function render()
    {
        if ($cachedView = $this->getCachedView()) {
            return response()->make($cachedView, 200, ['Content-type' => 'text/xml']);
        }

        $sitemap = response()->view('sitemap::sitemap', [
            '__tags' => $this->getTags(),
            '__hasImages' => $this->imagesPresent(),
            '__hasVideos' => $this->videosPresent(),
            '__isMultilingual' => $this->multilingualTagsPresent()
        ], 200, ['Content-type' => 'text/xml']);

        $this->saveCachedView($sitemap);

        return $sitemap;
    }
153773
public function render()
    {
        $key = $this->getInputProcessor()->getUniqueRequestId();
        $caching_time = $this->config->getCachingTime();
        if ($caching_time && ($output = Cache::get($key))) {
            return $output;
        } else {
            $this->prepare();
            $provider = $this->config->getDataProvider();
            $provider->reset();
            $output = View::make(
                $this->getMainTemplate(),
                $this->getViewData()
            )->render();
            if ($caching_time) {
                Cache::put($key, $output, $caching_time);
            }
            return $output;
        }
    }