Skip to main content

ChromeTraceLoader

ChromeTraceLoader loads Chrome Trace Event JSON payloads. By default it returns a validated JSON trace object. Set chromeTrace.shape: 'arrow-table' to convert trace events into an Apache Arrow table.

Usage​

import {load} from '@loaders.gl/core';
import {ChromeTraceLoader} from '@loaders.gl/traces';

const trace = await load(url, ChromeTraceLoader);

const table = await load(url, ChromeTraceLoader, {
chromeTrace: {shape: 'arrow-table'}
});

Options​

OptionTypeDefaultDescription
chromeTrace.shape'json' | 'arrow-table'jsonSelects the whole-file parser output shape.
chromeTrace.batchSizenumber256Maximum events per Arrow record batch.
maxLengthnumberMaximum input byte length accepted by the loader.

Streaming​

parseInBatches currently requires chromeTrace.shape: 'arrow-table' and yields Arrow record batches. The module also exports helpers that consume Chrome trace file chunks or Arrow batches and publish trace snapshots.