Skip to content

Instantly share code, notes, and snippets.

@pmuellr

pmuellr/profile.d.ts

Created Aug 11, 2017
Embed
What would you like to do?
profile.d.ts
interface Profile {
meta: Meta
nodes: Node []
scripts: Script []
pkgs: Pkg []
urlBase: string // common full url across packages and mainModule
totalTime: number // microseconds
maxSelfTime: number // microseconds
maxTotalTime: number // microseconds
}
interface Meta {
arch?: string // from node process object
platform?: string // from node process object
pid?: number // from node process object
execPath?: string // from node process object
mainModule?: string // filename of main module, relative to urlBase
moarVersion?: string // semver of version of moar used
}
interface Node {
id: number
pkg: Pkg
script: Script
functionName: string
line: number // line number in script (1-based)
lines: Line []
children: Node []
selfTime: number // microseconds
totalTime: number // microseconds
isProgram: boolean
isIdle: boolean
isGC: boolean
}
interface Line {
id: number
line: number // line number in script (1-based)
selfTime: number // microseconds
pkg: Pkg
script: Script
node: Node
}
interface Pkg {
id: number
name: string // may be (system) or (unknown)
url: string // may be (system) or (unknown), or relative to urlBase
description?: string // from package.json
homepage?: string // from package.json
version?: string // from package.json
nodes: Node []
scripts: Script []
lines: Line[]
}
interface Script {
id: number
url: string // url of script, relative to urlBase
urlPkg: string // url of script, relative to pkg's url
pkg: Pkg
nodes: Node []
lines: Line []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.