Chrome DevTools Protocol

Methods

Profiler.disable

Profiler.enable

Profiler.getBestEffortCoverage

Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection.

Return Object
result
array[ ScriptCoverage ]

Coverage data for the current isolate.

Profiler.setSamplingInterval

Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.

parameters
interval
integer

New sampling interval in microseconds.

Profiler.start

Profiler.startPreciseCoverage

Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters.

parameters
callCount
boolean

Collect accurate call counts beyond simple 'covered' or 'not covered'.

detailed
boolean

Collect block-based coverage.

allowTriggeredUpdates
boolean

Allow the backend to send updates on its own initiative

Return Object
timestamp
number

Monotonically increasing time (in seconds) when the coverage update was taken in the backend.

Profiler.stop

Return Object
profile
Profile

Recorded profile.

Profiler.stopPreciseCoverage

Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code.

Profiler.takePreciseCoverage

Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started.

Return Object
result
array[ ScriptCoverage ]

Coverage data for the current isolate.

timestamp
number

Monotonically increasing time (in seconds) when the coverage update was taken in the backend.

Profiler.disableCounters Experimental

Disable counters collection.

Profiler.disableRuntimeCallStats Experimental

Disable run time call stats collection.

Profiler.enableCounters Experimental

Enable counters collection.

Profiler.enableRuntimeCallStats Experimental

Enable run time call stats collection.

Profiler.getCounters Experimental

Retrieve counters.

Return Object
result
array[ CounterInfo ]

Collected counters information.

Profiler.getRuntimeCallStats Experimental

Retrieve run time call stats.

Return Object
result
array[ RuntimeCallCounterInfo ]

Collected runtime call counter information.

Profiler.startTypeProfile Experimental

Enable type profile.

Profiler.stopTypeProfile Experimental

Disable type profile. Disabling releases type profile data collected so far.

Profiler.takeTypeProfile Experimental

Collect type profile.

Return Object
result
array[ ScriptTypeProfile ]

Type profile for all scripts since startTypeProfile() was turned on.

Events

Profiler.consoleProfileFinished

parameters
id
string
location
Debugger.Location

Location of console.profileEnd().

profile
Profile
title
string

Profile title passed as an argument to console.profile().

Profiler.consoleProfileStarted

Sent when new profile recording is started using console.profile() call.

parameters
id
string
location
Debugger.Location

Location of console.profile().

title
string

Profile title passed as an argument to console.profile().

Profiler.preciseCoverageDeltaUpdate Experimental

Reports coverage delta since the last poll (either from an event like this, or from takePreciseCoverage for the current isolate. May only be sent if precise code coverage has been started. This event can be trigged by the embedder to, for example, trigger collection of coverage data immediatelly at a certain point in time.

parameters
timestamp
number

Monotonically increasing time (in seconds) when the coverage update was taken in the backend.

occassion
string

Identifier for distinguishing coverage events.

result
array[ ScriptCoverage ]

Coverage data for the current isolate.

Types

Profiler.CoverageRange

Coverage data for a source range.

Type: object

properties
startOffset
integer

JavaScript script source offset for the range start.

endOffset
integer

JavaScript script source offset for the range end.

count
integer

Collected execution count of the source range.

Profiler.FunctionCoverage

Coverage data for a JavaScript function.

Type: object

properties
functionName
string

JavaScript function name.

ranges
array[ CoverageRange ]

Source ranges inside the function with coverage data.

isBlockCoverage
boolean

Whether coverage data for this function has block granularity.

Profiler.PositionTickInfo

Specifies a number of samples attributed to a certain source position.

Type: object

properties
line
integer

Source line number (1-based).

ticks
integer

Number of samples attributed to the source line.

Profiler.Profile

Profile.

Type: object

properties
nodes
array[ ProfileNode ]

The list of profile nodes. First item is the root node.

startTime
number

Profiling start timestamp in microseconds.

endTime
number

Profiling end timestamp in microseconds.

samples
array[ integer ]

Ids of samples top nodes.

timeDeltas
array[ integer ]

Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime.

Profiler.ProfileNode

Profile node. Holds callsite information, execution statistics and child nodes.

Type: object

properties
id
integer

Unique id of the node.

callFrame
Runtime.CallFrame

Function location.

hitCount
integer

Number of samples where this node was on top of the call stack.

children
array[ integer ]

Child node ids.

deoptReason
string

The reason of being not optimized. The function may be deoptimized or marked as don't optimize.

positionTicks
array[ PositionTickInfo ]

An array of source position ticks.

Profiler.ScriptCoverage

Coverage data for a JavaScript script.

Type: object

properties
scriptId
Runtime.ScriptId

JavaScript script id.

url
string

JavaScript script name or url.

functions
array[ FunctionCoverage ]

Functions contained in the script that has coverage data.

Profiler.CounterInfo Experimental

Collected counter information.

Type: object

properties
name
string

Counter name.

value
integer

Counter value.

Profiler.RuntimeCallCounterInfo Experimental

Runtime call counter information.

Type: object

properties
name
string

Counter name.

value
number

Counter value.

time
number

Counter time in seconds.

Profiler.ScriptTypeProfile Experimental

Type profile data collected during runtime for a JavaScript script.

Type: object

properties
scriptId
Runtime.ScriptId

JavaScript script id.

url
string

JavaScript script name or url.

entries
array[ TypeProfileEntry ]

Type profile entries for parameters and return values of the functions in the script.

Profiler.TypeObject Experimental

Describes a type collected during runtime.

Type: object

properties
name
string

Name of a type collected with type profiling.

Profiler.TypeProfileEntry Experimental

Source offset and types for a parameter or return value.

Type: object

properties
offset
integer

Source offset of the parameter or end of function for return values.

types
array[ TypeObject ]

The types for this parameter or return value.