protocol/profiler
⚙️ This module was generated from the Chrome DevTools Protocol version 1.3
Profiler Domain
This protocol domain has no description.
📖 View this domain on the DevTools Protocol API Docs
Types
Coverage data for a source range.
pub type CoverageRange {
CoverageRange(start_offset: Int, end_offset: Int, count: Int)
}
Constructors
-
CoverageRange(start_offset: Int, end_offset: Int, count: Int)
Arguments
-
start_offset
JavaScript script source offset for the range start.
-
end_offset
JavaScript script source offset for the range end.
-
count
Collected execution count of the source range.
-
Coverage data for a JavaScript function.
pub type FunctionCoverage {
FunctionCoverage(
function_name: String,
ranges: List(CoverageRange),
is_block_coverage: Bool,
)
}
Constructors
-
FunctionCoverage( function_name: String, ranges: List(CoverageRange), is_block_coverage: Bool, )
Arguments
-
function_name
JavaScript function name.
-
ranges
Source ranges inside the function with coverage data.
-
is_block_coverage
Whether coverage data for this function has block granularity.
-
This type is not part of the protocol spec, it has been generated dynamically
to represent the response to the command get_best_effort_coverage
pub type GetBestEffortCoverageResponse {
GetBestEffortCoverageResponse(result: List(ScriptCoverage))
}
Constructors
-
GetBestEffortCoverageResponse(result: List(ScriptCoverage))
Arguments
-
result
Coverage data for the current isolate.
-
Specifies a number of samples attributed to a certain source position.
pub type PositionTickInfo {
PositionTickInfo(line: Int, ticks: Int)
}
Constructors
-
PositionTickInfo(line: Int, ticks: Int)
Arguments
-
line
Source line number (1-based).
-
ticks
Number of samples attributed to the source line.
-
Profile.
pub type Profile {
Profile(
nodes: List(ProfileNode),
start_time: Float,
end_time: Float,
samples: option.Option(List(Int)),
time_deltas: option.Option(List(Int)),
)
}
Constructors
-
Profile( nodes: List(ProfileNode), start_time: Float, end_time: Float, samples: option.Option(List(Int)), time_deltas: option.Option(List(Int)), )
Arguments
-
nodes
The list of profile nodes. First item is the root node.
-
start_time
Profiling start timestamp in microseconds.
-
end_time
Profiling end timestamp in microseconds.
-
samples
Ids of samples top nodes.
-
time_deltas
Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime.
-
Profile node. Holds callsite information, execution statistics and child nodes.
pub type ProfileNode {
ProfileNode(
id: Int,
call_frame: runtime.CallFrame,
hit_count: option.Option(Int),
children: option.Option(List(Int)),
deopt_reason: option.Option(String),
position_ticks: option.Option(List(PositionTickInfo)),
)
}
Constructors
-
ProfileNode( id: Int, call_frame: runtime.CallFrame, hit_count: option.Option(Int), children: option.Option(List(Int)), deopt_reason: option.Option(String), position_ticks: option.Option(List(PositionTickInfo)), )
Arguments
-
id
Unique id of the node.
-
call_frame
Function location.
-
hit_count
Number of samples where this node was on top of the call stack.
-
children
Child node ids.
-
deopt_reason
The reason of being not optimized. The function may be deoptimized or marked as don’t optimize.
-
position_ticks
An array of source position ticks.
-
Coverage data for a JavaScript script.
pub type ScriptCoverage {
ScriptCoverage(
script_id: runtime.ScriptId,
url: String,
functions: List(FunctionCoverage),
)
}
Constructors
-
ScriptCoverage( script_id: runtime.ScriptId, url: String, functions: List(FunctionCoverage), )
Arguments
-
script_id
JavaScript script id.
-
url
JavaScript script name or url.
-
functions
Functions contained in the script that has coverage data.
-
This type is not part of the protocol spec, it has been generated dynamically
to represent the response to the command start_precise_coverage
pub type StartPreciseCoverageResponse {
StartPreciseCoverageResponse(timestamp: Float)
}
Constructors
-
StartPreciseCoverageResponse(timestamp: Float)
Arguments
-
timestamp
Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
-
This type is not part of the protocol spec, it has been generated dynamically
to represent the response to the command stop
pub type StopResponse {
StopResponse(profile: Profile)
}
Constructors
-
StopResponse(profile: Profile)
Arguments
-
profile
Recorded profile.
-
This type is not part of the protocol spec, it has been generated dynamically
to represent the response to the command take_precise_coverage
pub type TakePreciseCoverageResponse {
TakePreciseCoverageResponse(
result: List(ScriptCoverage),
timestamp: Float,
)
}
Constructors
-
TakePreciseCoverageResponse( result: List(ScriptCoverage), timestamp: Float, )
Arguments
-
result
Coverage data for the current isolate.
-
timestamp
Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
-
Functions
pub fn disable(callback__: fn(String, Option(a)) -> b) -> b
This generated protocol command has no description
pub fn enable(callback__: fn(String, Option(a)) -> b) -> b
This generated protocol command has no description
pub fn get_best_effort_coverage(
callback__: fn(String, Option(a)) ->
Result(Dynamic, RequestError),
) -> Result(GetBestEffortCoverageResponse, RequestError)
Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection.
result
: Coverage data for the current isolate.
pub fn set_sampling_interval(
callback__: fn(String, Option(Json)) -> a,
interval interval: Int,
) -> a
Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.
Parameters:
interval
: New sampling interval in microseconds.
Returns:
pub fn start(callback__: fn(String, Option(a)) -> b) -> b
This generated protocol command has no description
pub fn start_precise_coverage(
callback__: fn(String, Option(Json)) ->
Result(Dynamic, RequestError),
call_count call_count: Option(Bool),
detailed detailed: Option(Bool),
allow_triggered_updates allow_triggered_updates: Option(Bool),
) -> Result(StartPreciseCoverageResponse, RequestError)
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:
call_count
: Collect accurate call counts beyond simple ‘covered’ or ‘not covered’.detailed
: Collect block-based coverage.allow_triggered_updates
: Allow the backend to send updates on its own initiative
Returns:
timestamp
: Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
pub fn stop(
callback__: fn(String, Option(a)) ->
Result(Dynamic, RequestError),
) -> Result(StopResponse, RequestError)
This generated protocol command has no description
profile
: Recorded profile.
pub fn stop_precise_coverage(
callback__: fn(String, Option(a)) -> b,
) -> b
Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code.
pub fn take_precise_coverage(
callback__: fn(String, Option(a)) ->
Result(Dynamic, RequestError),
) -> Result(TakePreciseCoverageResponse, RequestError)
Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started.
result
: Coverage data for the current isolate.timestamp
: Monotonically increasing time (in seconds) when the coverage update was taken in the backend.