Returns statistic by sources and names

@return array
777383
public function getStat()
    {
        $sources = [];
        $names = [];
        foreach ($this->lines as $line) {
            $line->loadStat($sources, $names);
        }
        return [
            'sources' => $sources,
            'names' => $names,
        ];
    }
733739
public function getAvailableCoreStats()
    {
        $result = [];
        if ($this->fs->isDirectory(DIR_LANGUAGES)) {
            foreach ($this->fs->directories(DIR_LANGUAGES) as $localeDirectory) {
                $localeID = basename($localeDirectory);
                if (preg_match('/^[a-z]{2,3}($|_)/', $localeID)) {
                    $mo = DIR_LANGUAGES . '/' . $localeID . '/LC_MESSAGES/messages.mo';
                    if ($this->fs->isFile($mo)) {
                        $result[$localeID] = $this->getMoFileStats($mo);
                    }
                }
            }
        }

        return $result;
    }
709340
public function getDatabases()
    {
        $data = [];

        foreach ($this->getMonitoredDatabases() as $db) {
            $data[] = ['connection' => $db['connection'],
                       'alert_greater_than_mb' => $db['alert_greater_than_mb'],
                       'alert_less_than_mb' => $db['alert_less_than_mb'],
                       'driver' => $this->getDriverName($db['connection']),
                       'status' => $this->checkDatabaseStatus($db['connection']),
                       'size' => $this->getDatabaseSize($db['connection'])];
        }

        return $data;
    }
118233
public function getFileInfo()
    {
        $fullName = str_replace('source/','',$this->fullName);
        return [
            "msg"    => $this->stateInfo,
            "code" => $this->stateInfo == "SUCCESS" ? 0 : $this->stateInfo,
            "data"=>[
                "src"=>$this->imgDomain.$fullName,
                'title'=>$fullName,
            ],
            "type"     => $this->fileType,
            "size"     => $this->fileSize
        ];
    }
343175
protected function getStatistics() {
        if (!$this->_statistics) {
            $this->_statistics = new WorkerStatisticsList(
                $this->version,
                $this->solution['workspaceSid'],
                $this->solution['sid']
            );
        }

        return $this->_statistics;
    }
1359873
public function stream_stat(): array
    {
        $fileStat = [
            'dev'     => 0,
            'ino'     => 0,
            'mode'    => $this->content->getType() | $this->content->getPermissions(),
            'nlink'   => 0,
            'uid'     => $this->content->getUser(),
            'gid'     => $this->content->getGroup(),
            'rdev'    => 0,
            'size'    => $this->content->size(),
            'atime'   => $this->content->fileatime(),
            'mtime'   => $this->content->filemtime(),
            'ctime'   => $this->content->filectime(),
            'blksize' => -1,
            'blocks'  => -1
        ];
        return array_merge(array_values($fileStat), $fileStat);
    }
1160079
public function sources()
    {
        if (is_null($this->sourceRequests)) {
            $this->sourceRequests = new SourceRequests($this->client);
        }

        return $this->sourceRequests;
    }
1028949
private function getFileResources()
    {
        $paths = array();

        foreach ($this->directories as $directory) {
            foreach ($directory as $file) {
                $relative = $this->getRelativeName($file, $directory);

                if (!isset($paths[$relative])) {
                    $paths[$relative] = $file;
                }
            }
        }

        return array_values($paths);
    }
218824
public function getSendStatistics()
    {
        $this->_action = 'GetSendStatistics';
        $this->_method = 'GET';
        $this->_refreshDate();

        $this->_generateSignature();
        $res = $this->_request();
        if ($res['code'] == 200) {
            $result = $res['body']->GetSendStatisticsResult->SendDataPoints->member;
            return array(
                'Complaints' => (string) $result->Complaints,
                'Rejects' => (string) $result->Rejects,
                'Bounces' => (string) $result->Bounces,
                'DeliveryAttempts' => (string) $result->DeliveryAttempts,
                'Timestamp' => (string) $result->Timestamp
            );
        } else {
            return new SimpleEmailServiceError((string) $res['body']->Error->Code);
        }
    }
613179
public static function getManagersStats()
    {

        $managersStats = [];
        foreach (static::$producers as $appId => $producer) {

            /** @var $producer Producer */
            $redis = $producer->getRedis();
            $keys = [
                'stat' => $redis->keys(Manager::REDIS_NS_STATS . '*'),
                'live' => $redis->keys(Manager::REDIS_NS_LIVE . '*')
            ];

            foreach ($keys as $type => $statsKeys) {
                foreach ($statsKeys as $statsKey) {
                    $parse = Manager::parseManagerStatKey($statsKey);
                    if ($appId != $parse['appId']) {
                        continue;
                    }

                    $statsItemData = $redis->hgetall($statsKey);
                    $statsItemData['workerClass'] = $parse['workerClass'];
                    $statsItemData['appId'] = $parse['appId'];
                    $managersStats[$parse['appId']][$type][] = $statsItemData;
                }
            }

        }

        return $managersStats;
    }
688908
public function getSourceByName($source_name)
    {
        if ($this->hasSourceName($source_name)) {
            foreach ($this->sources() as $source) {
                if ($source->getName() === $source_name) {
                    return $source;
                }
            }
        }
    }
1322145
public function getWritableSources()
    {
        $returnValue = array();
        foreach ($this->getMediaSources() as $id => $source) {
            if ($source instanceof MediaManagement) {
                $returnValue[$id] = $source;
            }
        }
        return $returnValue;
    }
1010324
private function getAllInfo()
    {
        $data = [];
        foreach ($this->_parser->find('.genre-list a') as $each_genre) {
            $genre = [];

            $link = $each_genre->href;
            $link = explode('/', $link);
            $id = $link[3];
            $genre['id'] = $id;

            $name = str_replace('_', ' ', $link[4]);
            $genre['name'] = $name;

            $genre['count'] = $this->getGenreCount($each_genre);

            $data[] = $genre;
        }

        return $data;
    }
1144680
public static function getNameList(): array
    {
        $list = [];
        foreach (self::getAll() as $tree) {
            $list[$tree->name] = $tree->title;
        }

        return $list;
    }
701107
public function getStatisticsLogsDev():array
    {
        $last = array_values((AbstractServer::getLogs("dev")));
        $success = 0;
        $critical = 0;
        $others = 0;
        $errors = 0;
        for ($i = 0; $i < count($last); $i++) {
            $one = $last[$i];
            if ($one['code'] == 200) {
                $success++;
            } else {
                $errors++;
                if ($one['code'] == 500) {
                    $critical++;
                } else {
                    $others++;
                }
            }
        }
        return (array("errors" => $errors, "critical" => $critical,
            "success" => $success, "others" => $others));
    }
454301
public function findAll()
    {
        $datasourceNodes = array();
        foreach ($this->getSystemConfiguration()->getDatasources() as $datasourceNode) {
            $datasourceNodes[$datasourceNode->getPrimaryKey()] = $datasourceNode;
        }

        return $datasourceNodes;
    }
363019
public function getStats()
    {
        $directory = new \RecursiveIteratorIterator(
            new \RecursiveDirectoryIterator($this->path),
            \RecursiveIteratorIterator::SELF_FIRST
        );

        $cacheIterator = new \RegexIterator($directory, '/^.+\.cache/i', \RecursiveRegexIterator::GET_MATCH);

        $stats[ 'path' ] = $this->path;
        $stats[ 'files' ] = 0;
        $stats[ 'size' ] = 0;

        foreach ($cacheIterator as $cacheFiles) {
            foreach ($cacheFiles as $cacheFile) {
                $stats[ 'files' ]++;
                $stats[ 'size' ] += filesize($cacheFile);
            }
        }

        return $stats;
    }