Calculates cache slot statistics.

@return ScriptSlots
168699
protected function calculateCacheSlots()
    {
        $cachedScripts = $this->data['opcache_statistics']['num_cached_scripts'];
        $wasted        = $this->data['opcache_statistics']['num_cached_keys'] - $cachedScripts;
        return new ScriptSlots(
            $cachedScripts,
            $this->data['opcache_statistics']['max_cached_keys'],
            $wasted
        );
    }
1042496
function defaultSlots(slots) {
      return Array.isArray(slots)
        ? slots.slice()
        : googletag.pubads().getSlots().slice();
    }
536195
public function getNumberOfItemSlots(): int
    {
        if ($this->numberOfItemSlots === self::VALUE_UNLIMITED_SLOTS_DATABASE) {
            $result = self::VALUE_UNLIMITED_SLOTS;
        } else {
            $result = $this->numberOfItemSlots;
        }
        return $result;
    }
1188028
public function get_slots($page = 'all') {
        if ($page === 'all') {
            $numbers = array();
            foreach ($this->pagelayout as $numbersonpage) {
                $numbers = array_merge($numbers, $numbersonpage);
            }
            return $numbers;
        } else {
            return $this->pagelayout[$page];
        }
    }
714707
public function getCaches()
    {
        $caches = $this->_caches;
        foreach ($this->_optionTemplates as $name => $tmp) {
            if (!isset($caches[$name])) {
                $caches[$name] = $this->getCache($name);
            }
        }
        return $caches;
    }
1300761
public static function calculate($numSlots = 1, $numCores = 1, $ht = 'N') {
        $totalCpu = ($ht == 'S') ? (($numSlots * $numCores) * 2) : ($numSlots * $numCores);

        $aReturn = Array();
        $aReturn['warning'] = Array();
        $aReturn['critical'] = Array();

        $aReturn['warning']['load1min'] = round(($totalCpu * 0.7), 2);
        $aReturn['warning']['load5min'] = round(($totalCpu * 0.65), 2);
        $aReturn['warning']['load15min'] = round(($totalCpu * 0.6), 2);

        $aReturn['critical']['load1min'] = round(($totalCpu * 1.0), 2);
        $aReturn['critical']['load5min'] = round(($totalCpu * 0.9), 2);
        $aReturn['critical']['load15min'] = round(($totalCpu * 0.8), 2);

        return $aReturn;
    }
70086
public function getSlot($key)
    {
        if (isset($this->_slots[$key])) {
            if (is_string($this->_slots[$key])) {
                return $this->_slots[$key];
            }
            ob_start();
            call_user_func($this->_slots[$key][0], $this->_slots[$key][1], $this->_slots[$key][2]);
            return ob_get_clean();
        } else if ($this->_parentContext) {
            return $this->_parentContext->getSlot($key);
        }
    }
814635
public function rowCounts()
    {
        if (!$this->rowCounts) {
            foreach ($this->data['resultSets'] as $resultSet) {
                $this->rowCounts[] = $resultSet['stats']['rowCountExact'];
            }
        }

        return $this->rowCounts;
    }
1020215
public function getFillingPercentage()
    {
        $mems = $this->_memcache->getStats();
        if ($mems === false) {
            return 0;
        }

        $memSize = null;
        $memUsed = null;
        foreach ($mems as $key => $mem) {
            if ($mem === false) {
                $this->_log('can\'t get stat from ' . $key);
                continue;
            }

            $eachSize = $mem['limit_maxbytes'];
            $eachUsed = $mem['bytes'];
            if ($eachUsed > $eachSize) {
                $eachUsed = $eachSize;
            }

            $memSize += $eachSize;
            $memUsed += $eachUsed;
        }

        if ($memSize === null || $memUsed === null) {
            Zend_Cache::throwException('Can\'t get filling percentage');
        }

        return ((int) (100. * ($memUsed / $memSize)));
    }
769696
def find_slots(cls):
    """"""

    slots = set()
    for c in cls.__mro__:
        cslots = getattr(c, "__slots__", tuple())

        if not cslots:
            continue
        elif isinstance(cslots, (bstr, ustr)):
            cslots = (cslots,)

        slots.update(cslots)

    return slots
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;
    }
750562
public function getSlotContents()
    {
        if ($this->slots === null) {
            $fileService = new File();
            $appVersion = Config::get('concrete.version');
            $cfToken = Marketplace::getSiteToken();
            $url = Config::get('concrete.urls.newsflow') . Config::get('concrete.urls.paths.newsflow_slot_content');
            $path = $url . '?cfToken=' . rawurlencode($cfToken) . '&appVersion=' . $appVersion;
            $response = $fileService->getContents($path);
            $nsi = new NewsflowSlotItem();
            $this->slots = $nsi->parseResponse($response);
        }

        return $this->slots;
    }
1012752
public function getSlotManagers($removeIncludedSlots = false)
    {
        return ( ! $removeIncludedSlots) ? $this->slotManagers : array_intersect_key($this->slotManagers, array_flip(array_keys($this->themeSlots->getSlots())));
    }
50024
public function count()
    {
        $c = 0;
        // Using Pimple::$values will return the Closures, so instead get the
        // values in the container via ArrayAccess.
        foreach ($this->keys() as $valueName) {
            if ($this[$valueName] instanceof Slot) {
                ++$c;
            }
        }
        return $c;
    }
930371
protected function getStatistics() {
        if (!$this->_statistics) {
            $this->_statistics = new TaskQueueStatisticsList(
                $this->version,
                $this->solution['workspaceSid'],
                $this->solution['sid']
            );
        }

        return $this->_statistics;
    }
1074400
public function get_active_slots($page = 'all') {
        $activeslots = array();
        foreach ($this->get_slots($page) as $slot) {
            if (!$this->is_blocked_by_previous_question($slot)) {
                $activeslots[] = $slot;
            }
        }
        return $activeslots;
    }
1017347
public static function getFunctionSlot($functionName)
    {
        if (isset(self::$cacheFunctionSlots[$functionName])) {
            return self::$cacheFunctionSlots[$functionName];
        }

        $slot = self::$slot++;
        if ($slot >= self::MAX_SLOTS_NUMBER) {
            return 0;
        }

        self::$cacheFunctionSlots[$functionName] = $slot;

        return $slot;
    }