public void endRendering(RenderContext rc) { long now = System.currentTimeMillis(); this.markEnd(this.renderMetrics, now); this.assembleCacheMetrics(this.renderResourceCacheMetrics, rc.renderResourceCache); }
public double getDrawTimeAverage() { synchronized (this.drawLock) { return this.computeTimeAverage(this.drawMetrics); } }
public double getDrawTimeStdDev() { synchronized (this.drawLock) { return this.computeTimeStdDev(this.drawMetrics); } }
protected boolean printMetrics() { // Assemble the current system memory info. ActivityManager am = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE); ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo(); am.getMemoryInfo(mi); // Assemble the current WorldWind frame metrics. FrameMetrics fm = this.getWorldWindow().getFrameMetrics(); // Print a log message with the system memory, WorldWind cache usage, and WorldWind average frame time. Logger.log(Logger.INFO, String.format(Locale.US, "System memory %,.0f KB Heap memory %,.0f KB Render cache %,.0f KB Frame time %.1f ms + %.1f ms", (mi.totalMem - mi.availMem) / 1024.0, (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024.0, fm.getRenderResourceCacheUsedCapacity() / 1024.0, fm.getRenderTimeAverage(), fm.getDrawTimeAverage())); // Reset the accumulated WorldWind frame metrics. fm.reset(); // Print the frame metrics again after the configured delay. return this.handler.sendEmptyMessageDelayed(PRINT_METRICS, PRINT_METRICS_DELAY); }
protected void printTimeMetrics(TimeMetrics metrics, StringBuilder out) { out.append("lastTime=").append(metrics.time).append("ms"); out.append(", totalTime=").append(metrics.timeSum).append("ms"); out.append(", count=").append(metrics.count); out.append(", avg=").append(String.format(Locale.US, "%.1f", this.computeTimeAverage(metrics))).append("ms"); out.append(", stdDev=").append(String.format(Locale.US, "%.1f", this.computeTimeStdDev(metrics))).append("ms"); }
@Override public void run() { if (!isActivityThread()) { runOnActivityThread(this); } else { this.wwd.getFrameMetrics().reset(); } } }
this.frameMetrics.beginDrawing(this.dc); this.frameMetrics.endDrawing(this.dc);
this.frameMetrics.beginRendering(this.rc); this.frameMetrics.endRendering(this.rc);
protected boolean printMetrics() { WorldWindow wwd = this.getWorldWindow(); if (wwd == null) { return false; } // Assemble the current system memory info. ActivityManager am = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE); ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo(); am.getMemoryInfo(mi); // Assemble the current WorldWind frame metrics. FrameMetrics fm = this.getWorldWindow().getFrameMetrics(); // Print a log message with the system memory, WorldWind cache usage, and WorldWind average frame time. Logger.log(Logger.INFO, String.format(Locale.US, "System memory %,.0f KB Heap memory %,.0f KB Render cache %,.0f KB Frame time %.1f ms + %.1f ms", (mi.totalMem - mi.availMem) / 1024.0, (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024.0, fm.getRenderResourceCacheUsedCapacity() / 1024.0, fm.getRenderTimeAverage(), fm.getDrawTimeAverage())); // Reset the accumulated WorldWind frame metrics. fm.reset(); // Print the frame metrics again after the configured delay. return this.handler.sendEmptyMessageDelayed(PRINT_METRICS, PRINT_METRICS_DELAY); }
public double getRenderTimeAverage() { return this.computeTimeAverage(this.renderMetrics); }
public double getRenderTimeStdDev() { return this.computeTimeStdDev(this.renderMetrics); }