Skip to content
Snippets Groups Projects
js_protocol.json 72.2 KiB
Newer Older
  • Learn to ignore specific revisions
  •                 ]
                },
                {
                    "name": "takeHeapSnapshot",
                    "parameters": [
                        { "name": "reportProgress", "type": "boolean", "optional": true, "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken." }
                    ]
                },
                {
                    "name": "collectGarbage"
                },
                {
                    "name": "getObjectByHeapObjectId",
                    "parameters": [
                        { "name": "objectId", "$ref": "HeapSnapshotObjectId" },
                        { "name": "objectGroup", "type": "string", "optional": true, "description": "Symbolic group name that can be used to release multiple objects." }
                    ],
                    "returns": [
                        { "name": "result", "$ref": "Runtime.RemoteObject", "description": "Evaluation result." }
                    ]
                },
                {
                    "name": "addInspectedHeapObject",
                    "parameters": [
                        { "name": "heapObjectId", "$ref": "HeapSnapshotObjectId", "description": "Heap snapshot object id to be accessible by means of $x command line API." }
                    ],
                    "description": "Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions)."
                },
                {
                    "name": "getHeapObjectId",
                    "parameters": [
                        { "name": "objectId", "$ref": "Runtime.RemoteObjectId", "description": "Identifier of the object to get heap object id for." }
                    ],
                    "returns": [
                        { "name": "heapSnapshotObjectId", "$ref": "HeapSnapshotObjectId", "description": "Id of the heap snapshot object corresponding to the passed remote object id." }
                    ]
                },
                {
                    "name": "startSampling",
                    "parameters": [
                        { "name": "samplingInterval", "type": "number", "optional": true, "description": "Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes." }
                    ]
                },
                {
                    "name": "stopSampling",
                    "returns": [
                        { "name": "profile", "$ref": "SamplingHeapProfile", "description": "Recorded sampling heap profile." }
                    ]
                }
            ],
            "events": [
                {
                    "name": "addHeapSnapshotChunk",
                    "parameters": [
                        { "name": "chunk", "type": "string" }
                    ]
                },
                {
                    "name": "resetProfiles"
                },
                {
                    "name": "reportHeapSnapshotProgress",
                    "parameters": [
                        { "name": "done", "type": "integer" },
                        { "name": "total", "type": "integer" },
                        { "name": "finished", "type": "boolean", "optional": true }
                    ]
                },
                {
                    "name": "lastSeenObjectId",
    
    svatal's avatar
    svatal committed
                    "description": "If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.",
    
                    "parameters": [
                        { "name": "lastSeenObjectId", "type": "integer" },
                        { "name": "timestamp", "type": "number" }
                    ]
                },
                {
                    "name": "heapStatsUpdate",
                    "description": "If heap objects tracking has been started then backend may send update for one or more fragments",
                    "parameters": [
                        { "name": "statsUpdate", "type": "array", "items": { "type": "integer" }, "description": "An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment."}
                    ]
                }
            ]
        }]
    
    svatal's avatar
    svatal committed
    }