Returns some additional information about indexing progress, shown in
the scheduler's task overview list.

@return string Information to display
175440
public function getAdditionalInformation()
    {
        $site = $this->getSite();

        if (is_null($site)) {
            return 'Invalid site configuration for scheduler please re-create the task!';
        }

        $message = 'Site: ' . $site->getLabel();

        /** @var $indexService \ApacheSolrForTypo3\Solr\Domain\Index\IndexService */
        $indexService = $this->getInitializedIndexService($site);
        $failedItemsCount = $indexService->getFailCount();

        if ($failedItemsCount) {
            $message .= ' Failures: ' . $failedItemsCount;
        }

        $message .= ' / Using webroot: ' . htmlspecialchars($this->getWebRoot());

        return $message;
    }
1224156
public function getDisplayString()
    {
        $results[] = $this->getAdmissionTime()->toString($this->agenda->appointmentDisplayFormat);
        $results[] = $this->getActivityDescription();
        $results[] = $this->getProcedureDescription();
        $results[] = $this->getLocationDescription();
        $results[] = $this->getSubject();

        return implode($this->_('; '), array_filter($results));
    }
1283274
function statusText()
    {
        if ( $this->Progress == 100 )
        {
            return self::STATUS_COMPLETE;
        }

        if ( $this->Progress < 0 )
        {
            return self::STATUS_NOT_STARTED;
        }

        $timeSinceLastReport = time() - $this->LastReportTimestamp;

        if ( $timeSinceLastReport <= self::STATUS_ACTIVE_TIMEOUT )
        {
            return self::STATUS_ACTIVE;
        }

        if ( $timeSinceLastReport <= self::STATUS_DELAYED_TIMEOUT )
        {
            return self::STATUS_DELAYED;
        }

        return self::STATUS_DEAD;
    }
147580
public function getSummary()
    {
        if ($this->File() && $this->File()->exists()) {
            return $this->getSummaryThumbnail() . $this->dbObject('Content')->Summary(20);
        }
        return '';
    }
644109
public function getStatus()
    {
        $speed = round($this->getSpeed(), 2);
        $remaining = $this->getRemaining();

        // Remaining time
        $remainingTime = $this->getFormatTime($remaining);

        // Handled
        $handled = str_pad($this->handled, $this->allCountLength, ' ', STR_PAD_LEFT);

        return "Handled: $handled/$this->all\tRemaining: $remainingTime\tSpeed: $speed/sec";
    }
1133428
public function progressAction() {
        $data = BatchManager::instance()->stats($this->batchIdentifier());

        $data['status'] =  ($data['running']) ? 'running' : 'idle';
        $data['enabled'] = $this->enabled();

        json_response($data);
    }
459121
public function indexAction()
    {
        $results = array();
        $key  = '';
        $db   = '-1';
        if($this->getRequest()->isMethod('POST')) {
            $key = $this->getRequest()->get('key');
            $db  = $this->getRequest()->get('database');

            $keys = $this->getWorker()->keys($key, $db);

            if(empty($keys)) {
                $this->get('session')->getFlashBag()->add('notice', 'No result found');
            }else if(is_array($keys)) {
                foreach($keys as $k) {
                    $value = $this->getWorker()->get($k, $db);
                    $ttl = $this->getWorker()->ttl($k, $db);
                    $results[] = array(
                        'key'      => $k,
                        'value'    => $value,
                        'expireAt' => ($ttl == -1) ? '-' : strftime("%a %d %b %H:%M:%S %Y", time() + $ttl),
                        'weight'   => (mb_strlen($value, '8bit') / 1000). ' Kb'
                    );
                }
            }
        }

        return $this->render(
            $this->getTemplatePath().'index.html.twig',
            array(
                'instance'  => $this->getCurrentInstance(),
                'results'   => $results,
                'key'       => $key,
                'db'        => $db
            )
        );
    }
1321069
public function get_progress_bar() {
        global $PAGE;

        $stage = self::STAGE_COMPLETE;
        $currentstage = $this->stage->get_stage();
        $items = array();
        while ($stage > 0) {
            $classes = array('backup_stage');
            if (floor($stage / 2) == $currentstage) {
                $classes[] = 'backup_stage_next';
            } else if ($stage == $currentstage) {
                $classes[] = 'backup_stage_current';
            } else if ($stage < $currentstage) {
                $classes[] = 'backup_stage_complete';
            }
            $item = array('text' => strlen(decbin($stage)).'. '.get_string('currentstage'.$stage, 'backup'), 'class' => join(' ', $classes));
            if ($stage < $currentstage && $currentstage < self::STAGE_COMPLETE && (!self::$skipcurrentstage || ($stage * 2) != $currentstage)) {
                $params = $this->stage->get_params();
                if (empty($params)) {
                    $params = array();
                }
                $params = array_merge($params, array('backup' => $this->get_backupid(), 'stage' => $stage));
                $item['link'] = new moodle_url($PAGE->url, $params);
            }
            array_unshift($items, $item);
            $stage = floor($stage / 2);
        }
        return $items;
    }
104184
public function getSummary()
    {
        ob_start();

        printf(
            "%s error in file '%s' line %s",
            $this->getSeverityString(),
            $this->file,
            $this->line
        );

        return ob_get_clean();
    }
829230
public function getStatus()
    {
        $reports = [];
        $severity = Status::OK;
        $value = 'On';
        $message = '';

        if (!ini_get('allow_url_fopen')) {
            $severity = Status::ERROR;
            $value = 'Off';
            $message = 'allow_url_fopen must be enabled in php.ini to allow
				communication between TYPO3 and the Apache Solr server.
				Indexing pages using the Index Queue will also not work with
				this setting disabled.';
        }

        $reports[] = GeneralUtility::makeInstance(
            Status::class,
            /** @scrutinizer ignore-type */ 'allow_url_fopen',
            /** @scrutinizer ignore-type */ $value,
            /** @scrutinizer ignore-type */ $message,
            /** @scrutinizer ignore-type */ $severity
        );

        return $reports;
    }
595326
public function getProgress()
    {
        $site = $this->getSite();
        if (is_null($site)) {
            return 0.0;
        }

        /** @var $indexService \ApacheSolrForTypo3\Solr\Domain\Index\IndexService */
        $indexService = $this->getInitializedIndexService($site);

        return $indexService->getProgress();
    }
202173
public function progress()
    {
        try {
            $progress = $this->sdk()->jobs->progress($this->model->job_id);
            if ($progress->state == 'finished') {
                return 100;
            }

            return $progress->progress;
        } catch (\Exception $e) {
            return 0;
        }
    }
709739
private function getIndexStatus()
    {
        if (version_compare($this->version, '2.2', '>')) {
            return $this->client->indices()->stats(['index' => '_all']);
        }

        return $this->client->indices()->status(['index' => '_all']);
    }
454445
public function getSearchEngineSummary() {

		$configuration = Config::inst()->get(ExtensibleSearchPage::class, 'custom_search_engines');
		return isset($configuration[$this->SearchEngine]) ? $configuration[$this->SearchEngine] : $this->SearchEngine;
	}
10868
public function index()
    {
        return [
            'jobsPerMinute' => app(MetricsRepository::class)->jobsProcessedPerMinute(),
            'processes' => $this->totalProcessCount(),
            'queueWithMaxRuntime' => app(MetricsRepository::class)->queueWithMaximumRuntime(),
            'queueWithMaxThroughput' => app(MetricsRepository::class)->queueWithMaximumThroughput(),
            'recentlyFailed' => app(JobRepository::class)->countRecentlyFailed(),
            'recentJobs' => app(JobRepository::class)->countRecent(),
            'status' => $this->currentStatus(),
            'wait' => collect(app(WaitTimeCalculator::class)->calculate())->take(1),
            'periods' => [
                'recentJobs' => config('horizon.trim.recent'),
                'recentlyFailed' => config('horizon.trim.failed'),
            ],
        ];
    }
88670
public function getLastPage()
    {
        return $this->hasResults() ? ceil($this->adapter->getTotalResults() / $this->limit) : $this->getFirstPage();
    }
568227
protected function get_progress_trace_instance() {
        if ($this->progress === null) {
            if (!$this->table->is_downloading()) {
                $this->progress = new \core\progress\display_if_slow(get_string('calculatingallstats', 'quiz_statistics'));
                $this->progress->set_display_names();
            } else {
                $this->progress = new \core\progress\none();
            }
        }
        return $this->progress;
    }