Get admin stats

@return array
767622
public function stats() {
		$keys = [];
		$keys['unused_valid'] = $this->find('count', ['conditions' => [$this->getAlias() . '.used' => 0, $this->getAlias() . '.created >=' => date(FORMAT_DB_DATETIME, time() - $this->validity)]]);
		$keys['used_valid'] = $this->find('count', ['conditions' => [$this->getAlias() . '.used' => 1, $this->getAlias() . '.created >=' => date(FORMAT_DB_DATETIME, time() - $this->validity)]]);

		$keys['unused_invalid'] = $this->find('count', ['conditions' => [$this->getAlias() . '.used' => 0, $this->getAlias() . '.created <' => date(FORMAT_DB_DATETIME, time() - $this->validity)]]);
		$keys['used_invalid'] = $this->find('count', ['conditions' => [$this->getAlias() . '.used' => 1, $this->getAlias() . '.created <' => date(FORMAT_DB_DATETIME, time() - $this->validity)]]);

		$types = $this->find('all', ['conditions' => [], 'fields' => ['DISTINCT type']])->toArray();
		$keys['types'] = !empty($types) ? Hash::extract($types, '{n}.type') : [];
		return $keys;
	}
1087660
protected function getStatistics() {
        if (!$this->_statistics) {
            $this->_statistics = new TaskStatisticsList(
                $this->version,
                $this->solution['assistantSid'],
                $this->solution['sid']
            );
        }

        return $this->_statistics;
    }
816589
public function getStats() {
		return array(
			'inserts' => $this->cacheInserts,
			'deletes' => $this->cacheDeletes,
			'max'     => $this->maxCacheCount,
			'count'   => $this->count,
			'hits'    => $this->cacheHits,
			'misses'  => $this->cacheMisses
		);
	}
265056
public static function getStatuses()
    {
        return [
            self::STATUS_ACTIVE => Yii::t('podium/view', 'Active'),
            self::STATUS_BANNED => Yii::t('podium/view', 'Banned'),
            self::STATUS_REGISTERED => Yii::t('podium/view', 'Registered'),
        ];
    }
925147
public function getStatus()
    {
        $reports = [];
        $solrConnections = GeneralUtility::makeInstance(ConnectionManager::class)->getAllConnections();

        foreach ($solrConnections as $solrConnection) {
            $adminService = $solrConnection->getAdminService();
            if ($adminService->ping()) {
                $installationStatus = $this->checkPluginInstallationStatus($adminService);
                $versionStatus = $this->checkPluginVersion($adminService);

                if (!is_null($installationStatus)) {
                    $reports[] = $installationStatus;
                }

                if (!is_null($versionStatus)) {
                    $reports[] = $versionStatus;
                }
            }
        }

        return $reports;
    }
154765
public function admin()
    {
        $currentuser = $this->getUser();
        $users = $this->users()->getUsers();
        $sessions = $this->accessControl()->getActiveSessions();

        foreach ($users as $name => $user) {
            if (($key = array_search(Permissions::ROLE_EVERYONE, $user['roles'], true)) !== false) {
                unset($users[$name]['roles'][$key]);
            }
        }

        $context = [
            'currentuser' => $currentuser,
            'users'       => $users,
            'sessions'    => $sessions,
        ];

        return $this->render('@bolt/users/users.twig', $context);
    }
835296
public function getStatus()
    {
        $reports = [];
        $solrConnections = GeneralUtility::makeInstance(ConnectionManager::class)->getAllConnections();

        foreach ($solrConnections as $solrConnection) {
            $adminService = $solrConnection->getAdminService();

            if ($adminService->ping() && $adminService->getSolrconfigName() != self::RECOMMENDED_SOLRCONFIG_VERSION) {
                $variables = ['solr' => $adminService, 'recommendedVersion' => self::RECOMMENDED_SOLRCONFIG_VERSION];
                $report = $this->getRenderedReport('SolrConfigStatus.html', $variables);
                $status = GeneralUtility::makeInstance(
                    Status::class,
                    /** @scrutinizer ignore-type */ 'Solrconfig Version',
                    /** @scrutinizer ignore-type */ 'Unsupported solrconfig.xml',
                    /** @scrutinizer ignore-type */ $report,
                    /** @scrutinizer ignore-type */ Status::WARNING
                );

                $reports[] = $status;
            }
        }

        return $reports;
    }
906823
protected function formCounters()
    {
        $userCounter = $this->getUserCounter();

        $counters = [];

        if (!is_null($this->getUserCounter())) {
            $counters[] = [
                'name' => 'admin users',
                'value' => $userCounter->getAdminCount(),
            ];
            $counters[] = [
                'name' => 'active admin users',
                'value' => $userCounter->getActiveAdminCount(),
            ];
        }

        $counters[] = [
            'name' => 'subShops',
            'value' => \OxidEsales\Eshop\Core\Registry::getConfig()->getMandateCount(),
        ];

        return $counters;
    }
344691
public function findAdmins()
    {
        $qb = $this->createQueryBuilder('u');

        $qb->where($qb->expr()->eq('u.admin', $qb->expr()->literal(true)))
            ->andWhere($qb->expr()->isNull('u.templateOwner'))
            ->andWhere($qb->expr()->eq('u.deleted', $qb->expr()->literal(false)));

        return $qb->getQuery()->getResult();
    }
111674
public function collectStats()
    {
        Container::get('hooks')->fire('model.index.collect_stats_start');

        // Collect some statistics from the database
        if (!Container::get('cache')->isCached('users_info')) {
            Container::get('cache')->store('users_info', Cache::getUsersInfo());
        }

        $stats = Container::get('cache')->retrieve('users_info');

        $query = DB::forTable('forums')
            ->select_expr('SUM(num_topics)', 'total_topics')
            ->select_expr('SUM(num_posts)', 'total_posts');

        $query = Container::get('hooks')->fireDB('model.index.collect_stats_query', $query);

        $query = $query->find_one();

        $stats['total_topics'] = Utils::numberFormat((int)$query['total_topics']);
        $stats['total_posts'] = Utils::numberFormat((int)$query['total_posts']);

        if (User::get()->g_view_users == '1') {
            $stats['newest_user'] = '<a href="'.
                Router::pathFor('userProfile', ['id' => $stats['last_user']['id']]).'">'.
                Utils::escape($stats['last_user']['username']).'</a>';
        } else {
            $stats['newest_user'] = Utils::escape($stats['last_user']['username']);
        }
        $stats['total_users'] = Utils::numberFormat((int)$stats['total_users']);

        $stats = Container::get('hooks')->fire('model.index.collect_stats', $stats);

        return $stats;
    }
651057
public function getStatus() : array
    {

        return [
            'status'        => $this->engine->getStats(),
            'version'       => $this->engine->getVersion(),
            'server_list'   => $this->engine->getServerList()
        ];
    }
527952
public function stats() {
		$this->out('Jobs currently in the queue:');

		$types = $this->QueuedJobs->getTypes()->toArray();
		foreach ($types as $type) {
			$this->out('      ' . str_pad($type, 20, ' ', STR_PAD_RIGHT) . ': ' . $this->QueuedJobs->getLength($type));
		}
		$this->hr();
		$this->out('Total unfinished jobs: ' . $this->QueuedJobs->getLength());
		$this->out('Running workers (processes): ' . $this->QueueProcesses->findActive()->count());
		$this->out('Server name: ' . $this->QueueProcesses->buildServerString());
		$this->hr();
		$this->out('Finished job statistics:');
		$data = $this->QueuedJobs->getStats();
		foreach ($data as $item) {
			$this->out(' ' . $item['job_type'] . ': ');
			$this->out('   Finished Jobs in Database: ' . $item['num']);
			$this->out('   Average Job existence    : ' . str_pad(Number::precision($item['alltime']), 8, ' ', STR_PAD_LEFT) . 's');
			$this->out('   Average Execution delay  : ' . str_pad(Number::precision($item['fetchdelay']), 8, ' ', STR_PAD_LEFT) . 's');
			$this->out('   Average Execution time   : ' . str_pad(Number::precision($item['runtime']), 8, ' ', STR_PAD_LEFT) . 's');
		}
	}
162273
public function users()
    {
        //Only admins and managers can access this controller
        if (!$this->Auth->isGroup(['admin', 'manager'])) {
            return;
        }

        $links[] = [__d('me_cms', 'List users'), [
            'controller' => 'Users',
            'action' => 'index',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];
        $links[] = [__d('me_cms', 'Add user'), [
            'controller' => 'Users',
            'action' => 'add',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];

        //Only admins can access these actions
        if ($this->Auth->isGroup('admin')) {
            $links[] = [__d('me_cms', 'List groups'), [
                'controller' => 'UsersGroups',
                'action' => 'index',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
            $links[] = [__d('me_cms', 'Add group'), [
                'controller' => 'UsersGroups',
                'action' => 'add',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
        }

        return [$links, I18N_USERS, ['icon' => 'users']];
    }
278810
public function getStatusSummary()
    {
        $map = [
            'total' => Slave::ANY,
            'ready' => Slave::READY,
            'busy' => Slave::BUSY,
            'created' => Slave::CREATED,
            'registered' => Slave::REGISTERED,
            'closed' => Slave::CLOSED
        ];

        return array_map(function ($state) {
            return count($this->getByStatus($state));
        }, $map);
    }
366977
public function getAdminRecoveryData()
    {
        $oSession             = Factory::service('Session', 'nails/module-auth');
        $existingRecoveryData = $oSession->getUserData($this->sAdminRecoveryField);

        if (empty($existingRecoveryData)) {
            return [];
        } else {
            return end($existingRecoveryData);
        }
    }
600971
public function getAdminIndex()
    {
        // Grab all the users
        $users = Sentinel::createModel()->where('status', '=', '1')->Get();

        $possibleStatus = $this->status;
        $pending = false;

        // Show the page
        return View('admin.users.list', compact('users', 'possibleStatus', 'pending'));
    }
1365386
protected function getStatistics() {
        if (!$this->_statistics) {
            $this->_statistics = new WorkspaceStatisticsList($this->version, $this->solution['sid']);
        }

        return $this->_statistics;
    }