Web Inspector: Timelines: can't reliably stop/start a recording
[WebKit-https.git] / Source / JavaScriptCore / inspector / protocol / ScriptProfiler.json
1 {
2     "domain": "ScriptProfiler",
3     "description": "Profiler domain exposes JavaScript evaluation timing and profiling.",
4     "availability": ["javascript", "web"],
5     "types": [
6         {
7             "id": "EventType",
8             "type": "string",
9             "enum": ["API", "Microtask", "Other"]
10         },
11         {
12             "id": "Event",
13             "type": "object",
14             "properties": [
15                 { "name": "startTime", "type": "number" },
16                 { "name": "endTime", "type": "number" },
17                 { "name": "type", "$ref": "EventType" }
18             ]
19         },
20         {
21             "id": "ExpressionLocation",
22             "type": "object",
23             "properties": [
24                 { "name": "line", "type": "integer", "description": "1-based." },
25                 { "name": "column", "type": "integer", "description": "1-based." }
26             ]
27         },
28         {
29             "id": "StackFrame",
30             "type": "object",
31             "properties": [
32                 { "name": "sourceID", "$ref": "Debugger.ScriptId", "description": "Unique script identifier." },
33                 { "name": "name", "type": "string", "description": "A displayable name for the stack frame. i.e function name, (program), etc." },
34                 { "name": "line", "type": "integer", "description": "-1 if unavailable. 1-based if available." },
35                 { "name": "column", "type": "integer", "description": "-1 if unavailable. 1-based if available." },
36                 { "name": "url", "type": "string" },
37                 { "name": "expressionLocation", "$ref": "ExpressionLocation", "optional": true }
38             ]
39         },
40         {
41             "id": "StackTrace",
42             "type": "object",
43             "properties": [
44                 { "name": "timestamp", "type": "number" },
45                 { "name": "stackFrames", "type": "array", "items": { "$ref": "StackFrame" }, "description": "First array item is the bottom of the call stack and last array item is the top of the call stack." }
46             ]
47         },
48         {
49             "id": "Samples",
50             "type": "object",
51             "properties": [
52                 { "name": "stackTraces", "type": "array", "items": { "$ref": "StackTrace" } }
53             ]
54         }
55     ],
56     "commands": [
57         {
58             "name": "startTracking",
59             "description": "Start tracking script evaluations.",
60             "parameters": [
61                 { "name": "includeSamples", "type": "boolean", "optional": true, "description": "Start the sampling profiler, defaults to false." }
62             ]
63         },
64         {
65             "name": "stopTracking",
66             "description": "Stop tracking script evaluations. This will produce a `trackingComplete` event."
67         }
68     ],
69     "events": [
70         {
71             "name": "trackingStart",
72             "description": "Tracking started.",
73             "parameters": [
74                 { "name": "timestamp", "type": "number" }
75             ]
76         },
77         {
78             "name": "trackingUpdate",
79             "description": "Periodic tracking updates with event data.",
80             "parameters": [
81                 { "name": "event", "$ref": "Event" }
82             ]
83         },
84         {
85             "name": "trackingComplete",
86             "description": "Tracking stopped. Includes any buffered data during tracking, such as profiling information.",
87             "parameters": [
88                 { "name": "timestamp", "type": "number" },
89                 { "name": "samples", "$ref": "Samples", "optional": true, "description": "Stack traces." }
90             ]
91         }
92     ]
93 }