This defines a JSON-based file format for speedscope. The motivation for is primarily two things: 1. To enable others to write tools to output profiles which can be read by speedscope 2. To enable others to write tools to handle the output of speedscope, leveraging the variety of importers that speedscope supports Fixes #65
14 lines
413 B
JavaScript
14 lines
413 B
JavaScript
#!/usr/bin/env node
|
|
const child_process = require('child_process')
|
|
|
|
// Convert the file-format-spec.ts file into a json schema file
|
|
let jsonSchema = child_process.execSync(
|
|
'node_modules/.bin/quicktype --lang schema ./file-format-spec.ts',
|
|
{
|
|
encoding: 'utf8',
|
|
},
|
|
)
|
|
jsonSchema = JSON.parse(jsonSchema)
|
|
jsonSchema['$ref'] = '#/definitions/FileFormat.File'
|
|
console.log(JSON.stringify(jsonSchema, null, 4))
|