UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

3 lines (2 loc) 1 kB
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */ import{isPerformanceInfoLayerView as e}from"../layers/support/LayerViewPerformanceInfo.js";import r from"./LayerPerformanceInfo.js";class o{constructor(o){if(this.totalMemory=0,this.usedMemory=0,this.quality=1,this.load=0,this.terrainMemory=0,this.edgesMemory=0,this.layerPerformanceInfos=new Array,this.cachedMemory=0,this.fboMemory=0,null!=o.resourceController){const e=o.resourceController.memoryController;this.totalMemory=1048576*(e.maxMemory??0),this.usedMemory=Math.round(e.usedMemory*this.totalMemory),this.quality=o.quality,this.load=o.resourceController.scheduler.load,this.cachedMemory=e.usedCacheMemory}this.terrainMemory=o.basemapTerrain?.usedMemory??0,this.edgesMemory=o.stage?.renderer.usedMemory.edges??0,this.fboMemory=o.stage?.renderer.usedMemory.fbos??0,o.allLayerViews?.items.forEach(o=>{e(o)&&this.layerPerformanceInfos.push(new r(o))}),this.layerPerformanceInfos.sort((e,r)=>r.memory-e.memory)}}export{o as default};