blob: 8c716828d69bb80b89e40faf9a7068823ee0fae0 [file] [log] [blame]
{
"domain": "Timeline",
"description": "Timeline provides its clients with instrumentation records that are generated during the page runtime. Timeline instrumentation can be started and stopped using corresponding commands. While timeline is started, it is generating timeline event records.",
"availability": ["web"],
"types": [
{
"id": "EventType",
"type": "string",
"description": "Timeline record type.",
"enum": [
"EventDispatch",
"ScheduleStyleRecalculation",
"RecalculateStyles",
"InvalidateLayout",
"Layout",
"Paint",
"Composite",
"RenderingFrame",
"TimerInstall",
"TimerRemove",
"TimerFire",
"EvaluateScript",
"TimeStamp",
"Time",
"TimeEnd",
"FunctionCall",
"ProbeSample",
"ConsoleProfile",
"RequestAnimationFrame",
"CancelAnimationFrame",
"FireAnimationFrame",
"ObserverCallback"
]
},
{
"id": "Instrument",
"type": "string",
"description": "Instrument types.",
"enum": [
"ScriptProfiler",
"Timeline",
"CPU",
"Memory",
"Heap"
]
},
{
"id": "TimelineEvent",
"type": "object",
"description": "Timeline record contains information about the recorded activity.",
"properties": [
{ "name": "type", "$ref": "EventType", "description": "Event type." },
{ "name": "data", "type": "object", "description": "Event data." },
{ "name": "children", "type": "array", "optional": true, "items": { "$ref": "TimelineEvent" }, "description": "Nested records." }
]
}
],
"commands": [
{
"name": "enable",
"description": "Enables Timeline domain events."
},
{
"name": "disable",
"description": "Disables Timeline domain events."
},
{
"name": "start",
"description": "Starts capturing instrumentation events.",
"parameters": [
{ "name": "maxCallStackDepth", "optional": true, "type": "integer", "description": "Samples JavaScript stack traces up to <code>maxCallStackDepth</code>, defaults to 5." }
]
},
{
"name": "stop",
"description": "Stops capturing instrumentation events."
},
{
"name": "setAutoCaptureEnabled",
"description": "Toggle auto capture state. If <code>true</code> the backend will disable breakpoints and start capturing on navigation. The backend will fire the <code>autoCaptureStarted</code> event when an auto capture starts. The frontend should stop the auto capture when appropriate and re-enable breakpoints.",
"parameters": [
{ "name": "enabled", "type": "boolean", "description": "New auto capture state." }
]
},
{
"name": "setInstruments",
"description": "Instruments to enable when capture starts on the backend (e.g. auto capture or programmatic capture).",
"parameters": [
{ "name": "instruments", "type": "array", "items": { "$ref": "Instrument" }, "description": "Instruments to enable." }
]
}
],
"events": [
{
"name": "eventRecorded",
"description": "Fired for every instrumentation event while timeline is started.",
"parameters": [
{ "name": "record", "$ref": "TimelineEvent", "description": "Timeline event record data." }
]
},
{
"name": "recordingStarted",
"description": "Fired when recording has started.",
"parameters": [
{ "name": "startTime", "type": "number", "description": "Start time of this new recording." }
]
},
{
"name": "recordingStopped",
"description": "Fired when recording has stopped.",
"parameters": [
{ "name": "endTime", "type": "number", "description": "End time of this recording." }
]
},
{
"name": "autoCaptureStarted",
"description": "Fired when auto capture started."
}
]
}