CDPotion.Domain.Profiler (cdpotion v0.1.4)
Summary
Types
Coverage data for a source range.
Coverage data for a JavaScript function.
Specifies a number of samples attributed to a certain source position.
Profile.
Profile node. Holds callsite information, execution statistics and child nodes.
Coverage data for a JavaScript script.
Functions
Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection.
Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.
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.
Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code.
Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started.
Types
coverage_range()
Coverage data for a source range.
function_coverage()
@type function_coverage() :: %{ functionName: String.t(), isBlockCoverage: boolean(), ranges: [coverage_range()] }
Coverage data for a JavaScript function.
position_tick_info()
Specifies a number of samples attributed to a certain source position.
profile()
@type profile() :: %{ endTime: number(), nodes: [profile_node()], samples: [integer()] | nil, startTime: number(), timeDeltas: [integer()] | nil }
Profile.
profile_node()
@type profile_node() :: %{ callFrame: CDPotion.Domain.Runtime.call_frame(), children: [integer()] | nil, deoptReason: String.t() | nil, hitCount: integer() | nil, id: integer(), positionTicks: [position_tick_info()] | nil }
Profile node. Holds callsite information, execution statistics and child nodes.
script_coverage()
@type script_coverage() :: %{ functions: [function_coverage()], scriptId: CDPotion.Domain.Runtime.script_id(), url: String.t() }
Coverage data for a JavaScript script.
Functions
disable()
enable()
get_best_effort_coverage()
Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection.
set_sampling_interval(interval)
Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.
Parameters:
- (Required)
interval
: New sampling interval in microseconds.
start()
start_precise_coverage(call_count \\ nil, detailed \\ nil, allow_triggered_updates \\ nil)
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:
- (Optional)
call_count
: Collect accurate call counts beyond simple 'covered' or 'not covered'. - (Optional)
detailed
: Collect block-based coverage. - (Optional)
allow_triggered_updates
: Allow the backend to send updates on its own initiative
stop()
stop_precise_coverage()
Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code.
take_precise_coverage()
Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started.