Reports statistics detailing the image manager cache performance and the current size of the
cached images.
964259
protected void reportCachePerformance ()
    {
        if (/* Log.getLevel() != Log.log.DEBUG || */
            _improv == null ||
            _cacheStatThrottle.throttleOp()) {
            return;
        }

        // compute our estimated memory usage
        long amem = 0;
        int asize = 0;
        synchronized (_atiles) {
            // first total up the active tiles
            Iterator<SoftReference<Tile>> iter = _atiles.values().iterator();
            while (iter.hasNext()) {
                SoftReference<Tile> sref = iter.next();
                Tile tile = sref.get();
                if (tile != null) {
                    asize++;
                    amem += tile.getEstimatedMemoryUsage();
                }
            }
        }
        log.info("Tile caches", "amem", (amem / 1024) + "k",
            "tmem", (Tile._totalTileMemory / 1024) + "k", "seen", _atiles.size(), "asize", + asize);
    }
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;
    }
1295934
function Cache(maxSize, debug, storage) {
    this.maxSize_ = maxSize || -1;
    this.debug_ = debug || false;
    this.storage_ = storage || new Cache.BasicCacheStorage();

    this.fillFactor_ = .75;

    this.stats_ = {};
    this.stats_['hits'] = 0;
    this.stats_['misses'] = 0;
    this.log_('Initialized cache with size ' + maxSize);
}
184394
def get_image_details(self):
        '''
        
        '''
        if Image.objects.count() == 0:
            return None

        total = Image.objects.count()
        count = 1
        for local_image in Image.objects.all():
            if not hasattr(local_image, 'image_info'):
                ImageInfo.objects.create(image=local_image)
                local_image.refresh_from_db()

            hash_ = local_image.image_info.image_hash

            if hash_ in self.image_hashes:
                self.log(WARNING, "Image found with matching hash", context={
                    "composite hash": hash_,
                    "hashed image ID": self.image_hashes[hash_].id,
                    "matching image ID": local_image.id,
                })
            else:
                self.image_hashes[hash_] = local_image

            self.log(ACTION, "{}/{} images processed".format(count, total))
            count += 1
861178
def report(measurements)
      width = measurements.max_by { |m| m.label.size }.label.size + 1
      puts "#{' ' * width}#{Benchmark::CAPTION}"
      measurements.each do |m|
        puts "#{m.label.to_s.ljust width} #{m}"
      end
    end
1158314
def image_show(self, image_id):
        '''
        
        '''
        nt_ks = self.compute_conn
        image = nt_ks.images.get(image_id)
        links = {}
        for link in image.links:
            links[link['rel']] = link['href']
        ret = {
            'name': image.name,
            'id': image.id,
            'status': image.status,
            'progress': image.progress,
            'created': image.created,
            'updated': image.updated,
            'metadata': image.metadata,
            'links': links,
        }
        if hasattr(image, 'minDisk'):
            ret['minDisk'] = image.minDisk
        if hasattr(image, 'minRam'):
            ret['minRam'] = image.minRam

        return ret
485046
public void cacheBaseStatistics(BaseStatistics statistics, String identifyer) {
		synchronized (this.baseStatisticsCache) {
			this.baseStatisticsCache.put(identifyer, statistics);
		}
	}
1237813
public function show()
    {
        include $this->cacheName . '.php';

        if (filesize($this->cacheName) > 524287) {
            File::output($this->cacheName);
        } else {
            readfile($this->cacheName);
        }
    }
556468
public function outputCacheImage()
    {
        try {
            $this->setUrlPathImage();
            $this->setFileImage();
            $this->setDirectoryImage();
            $this->tryOutputImage();
            $this->checkCacheDirectoryImage();
            $this->applyActionsImage();
            $this->tryOutputImage();
        } catch (Exception $ex) {
            $this->response->outputError404(false);
        }
    }
207375
def compute_and_save_video_metrics(
    output_dirs, problem_name, video_length, frame_shape):
  """"""
  statistics, all_results = compute_video_metrics_from_png_files(
      output_dirs, problem_name, video_length, frame_shape)
  for results, output_dir in zip(all_results, output_dirs):
    save_results(results, output_dir, problem_name)

  parent_dir = os.path.join(output_dirs[0], os.pardir)
  final_dir = os.path.join(parent_dir, "decode")
  tf.gfile.MakeDirs(parent_dir)

  save_results(statistics, final_dir, problem_name)
370828
def _batch_report(cls, request):
        
        if not newrelic:
            return
        metrics_cache = cls._get_metrics_cache()
        try:
            newrelic.agent.add_custom_parameter('user_id', request.user.id)
        except AttributeError:
            pass
        for key, value in metrics_cache.data.items():
            newrelic.agent.add_custom_parameter(key, value)
28950
public void report() {
        synchronized (this) {
            report(registry.getGauges(filter),
                    registry.getCounters(filter),
                    registry.getHistograms(filter),
                    registry.getMeters(filter),
                    registry.getTimers(filter));
        }
    }
1053773
public void enableObjectCacheStats() {
        final String methodName = "enableObjectCacheStats";
        try {
            if (null == _statsInstance) {
                _iCacheType = TYPE_OBJECT;

                if (tc.isDebugEnabled())
                    Tr.debug(tc, methodName + " Creating statistic for " + _sCacheName + " instance (object cache)");
                _statsInstance = StatsFactory.createStatsInstance(WSDynamicCacheStats.OBJECT_CACHE_TYPE_PREFIX + _sCacheName, _cacheRootStatsGroup,
                        null, this);

                if (null == _cacheObjectStatsGroup) {
                    if (tc.isDebugEnabled())
                        Tr.debug(tc, methodName + " Creating object cache group" + " for cacheName=" + _sCacheName);
                    _cacheObjectStatsGroup = StatsFactory.createStatsGroup(WSDynamicCacheStats.OBJECT_GROUP, templateCount15, _statsInstance, null,
                            this);
                    _csmObject = new CacheStatsModule(_sCacheName, WSDynamicCacheStats.OBJECT_COUNTERS, _cacheObjectStatsGroup, this);
                }

                if (_diskOffloadEnabled) {
                    if (_cacheDiskStatsGroup == null) {
                        if (tc.isDebugEnabled())
                            Tr.debug(tc, methodName + " Creating disk group" + " for cacheName=" + _sCacheName);
                        _cacheDiskStatsGroup = StatsFactory.createStatsGroup(WSDynamicCacheStats.DISK_GROUP, templateCount13, _statsInstance, null,
                                this);
                    }
                    _csmDisk = new CacheStatsModule(_sCacheName, WSDynamicCacheStats.DISK_OFFLOAD_ENABLED, _cacheDiskStatsGroup, this);
                }
            }
        } catch (StatsFactoryException e) {
            com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.cache.stat.CacheStatsModule", "176", this);
            if (tc.isDebugEnabled())
                Tr.debug(tc,
                        methodName + " Exception while enabling object cache stats for" + _sCacheName + " : " + ExceptionUtility.getStackTrace(e));
        }

    }
133123
public void showMemoryUsage() {
    logger.info("Memory used in task " + taskAttemptId);
    synchronized (this) {
      long memoryAccountedForByConsumers = 0;
      for (MemoryConsumer c: consumers) {
        long totalMemUsage = c.getUsed();
        memoryAccountedForByConsumers += totalMemUsage;
        if (totalMemUsage > 0) {
          logger.info("Acquired by " + c + ": " + Utils.bytesToString(totalMemUsage));
        }
      }
      long memoryNotAccountedFor =
        memoryManager.getExecutionMemoryUsageForTask(taskAttemptId) - memoryAccountedForByConsumers;
      logger.info(
        "{} bytes of memory were used by task {} but are not associated with specific consumers",
        memoryNotAccountedFor, taskAttemptId);
      logger.info(
        "{} bytes of memory are used for execution and {} bytes of memory are used for storage",
        memoryManager.executionMemoryUsed(), memoryManager.storageMemoryUsed());
    }
  }
99014
def make_image_cache(img_cache):
    
    log.info('Initiating the image cache at {0}'.format(img_cache))
    if not os.path.isdir(img_cache):
        utils.mkdir_p(img_cache)
        utils.mkdir_p(os.path.join(img_cache, '10.1371'))
        utils.mkdir_p(os.path.join(img_cache, '10.3389'))
141441
public function calcResourceMemorySize(): int {
		$imageData = getimagesize($this->filePath);
		
		return round(($imageData[0] * $imageData[1] * $imageData['bits'] * $imageData['channels'] / 8));
	}
329691
function CacheManager() {
  var self = this;
  self.caches = {};

  Object.defineProperty(self, 'stats', {
    get: function () {
      return Object.keys(self.caches).reduce(function(a,region){
        a[region] = self.caches[region].stats;
        return a;
      },{});
    }
  });
}