glendam/protocol/profiler
This module is generated from the Chrome DevTools Protocol schema.
Do not edit this file manually. Generator: dev/codegen/generate_bindings.gleam Regenerate with:
gleam run -m codegen/generate_bindings
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)Represents the CoverageRange protocol value.
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: protocol_support.BooleanSetting,
)
}
Constructors
-
FunctionCoverage( function_name: String, ranges: List(CoverageRange), is_block_coverage: protocol_support.BooleanSetting, )Represents the FunctionCoverage protocol value.
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))Represents the GetBestEffortCoverageResponse protocol value.
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)Represents the PositionTickInfo protocol value.
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)), )Represents the Profile protocol value.
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)), )Represents the ProfileNode protocol value.
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), )Represents the ScriptCoverage protocol value.
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)Represents the StartPreciseCoverageResponse protocol value.
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)Represents the StopResponse protocol value.
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, )Represents the TakePreciseCoverageResponse protocol value.
Arguments
- result
-
Coverage data for the current isolate.
- timestamp
-
Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
Values
pub fn disable(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
) -> Result(dynamic.Dynamic, chrome.RequestError)
This generated protocol command has no description
pub fn enable(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
) -> Result(dynamic.Dynamic, chrome.RequestError)
This generated protocol command has no description
pub fn get_best_effort_coverage(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
) -> Result(GetBestEffortCoverageResponse, chrome.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 callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
interval interval: Int,
) -> Result(dynamic.Dynamic, chrome.RequestError)
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 callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
) -> Result(dynamic.Dynamic, chrome.RequestError)
This generated protocol command has no description
pub fn start_precise_coverage(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
call_count call_count: option.Option(
protocol_support.BooleanSetting,
),
detailed detailed: option.Option(
protocol_support.BooleanSetting,
),
allow_triggered_updates allow_triggered_updates: option.Option(
protocol_support.BooleanSetting,
),
) -> Result(StartPreciseCoverageResponse, chrome.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 callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
) -> Result(StopResponse, chrome.RequestError)
This generated protocol command has no description
profile: Recorded profile.
pub fn stop_precise_coverage(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
) -> Result(dynamic.Dynamic, chrome.RequestError)
Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code.
pub fn take_precise_coverage(
callback callback__: fn(String, option.Option(json.Json)) -> Result(
dynamic.Dynamic,
chrome.RequestError,
),
) -> Result(TakePreciseCoverageResponse, chrome.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.