How to use the @here/harp-mapview.PerformanceStatistics.instance function in @here/harp-mapview

To help you get started, we’ve selected a few @here/harp-mapview examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github heremaps / harp.gl / @here / harp-examples / lib / PerformanceUtils.ts View on Github external
recordFrames(mapViewApp, 40, true).then(() => {
                    // Clear the stats, and render the the last frame again and then gather
                    // results.
                    PerformanceStatistics.instance.clearFrames();

                    recordFrames(mapViewApp, 20).then(frameResults => {
                        if (frameResults !== undefined) {
                            const appValues = frameResults.lastFrameStats!.appResults;

                            for (const decoderValue of DECODER_VALUES) {
                                frameResults.lastFrameStats!.frames.delete(decoderValue);
                                appValues.set(decoderValue, decodingStatistics[decoderValue]);
                            }
                            const lastFrameStats = addStatistics(frameResults.lastFrameStats!);

                            resolve(lastFrameStats);
                        } else {
                            resolve(undefined);
                        }
                    });
github heremaps / harp.gl / @here / harp-examples / lib / PerformanceUtils.ts View on Github external
});

        mapView.lookAt(new GeoCoordinates(52.518611, 13.376111), 8000, 0, 0);

        const mapControls = MapControls.create(mapView);

        mapView.resize(window.innerWidth, window.innerHeight);

        window.addEventListener("resize", () => {
            if ((mapView.canvas.parentNode! as HTMLDivElement).style.position !== "absolute") {
                mapView.resize(window.innerWidth, window.innerHeight);
            }
        });

        const glInfo = getVendorFomContext(mapView.renderer.context);
        PerformanceStatistics.instance.configs.set("gl.vendor", glInfo.vendor);
        PerformanceStatistics.instance.configs.set("gl.renderer", glInfo.renderer);

        return {
            mapView,
            mapControls,
            omvDataSourceConnected: false,
            mainDataSource: undefined
        };
    }
github heremaps / harp.gl / @here / harp-examples / lib / PerformanceUtils.ts View on Github external
.then(() => {
                    PerformanceStatistics.instance.appResults.set("startTime", appStartTime);
                    PerformanceStatistics.instance.appResults.set("initTime", appInitTime);
                    resolve(mapViewApp);
                })
                .catch(err => {
github heremaps / harp.gl / @here / harp-examples / lib / PerformanceUtils.ts View on Github external
const renderCallback = (event: RenderEvent) => {
                mapView.removeEventListener(MapViewEventNames.AfterRender, renderCallback);
                const renderedFrames = mapView.frameNumber - currentFrame;
                let lastFrameStats: SimpleFrameStatistics | undefined;

                if (returnLastFrameStats !== StatisticsMode.None) {
                    lastFrameStats = PerformanceStatistics.instance.getAsSimpleFrameStatistics(
                        returnLastFrameStats === StatisticsMode.LastFrame
                    );
                }

                resolve({ renderedFrames, lastFrameStats });
            };