Package io.webfolder.cdp.command
Interface ProfilerAsync
public interface ProfilerAsync
-
Method Summary
Modifier and TypeMethodDescriptiondisable()
enable()
Collect coverage data for the current isolate.setSamplingInterval
(Integer interval) Changes CPU profiler sampling interval.start()
Enable precise code coverage.startPreciseCoverage
(Boolean callCount, Boolean detailed, Boolean allowTriggeredUpdates) Enable precise code coverage.Enable type profile.stop()
Disable precise code coverage.Disable type profile.Collect coverage data for the current isolate, and resets execution counters.Collect type profile.
-
Method Details
-
disable
CompletableFuture<Void> disable() -
enable
CompletableFuture<Void> enable() -
getBestEffortCoverage
CompletableFuture<List<ScriptCoverage>> getBestEffortCoverage()Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection.- Returns:
- Coverage data for the current isolate.
-
setSamplingInterval
Changes CPU profiler sampling interval. Must be called before CPU profiles recording started.- Parameters:
interval
- New sampling interval in microseconds.
-
start
CompletableFuture<Void> start() -
startPreciseCoverage
CompletableFuture<Double> 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.- Returns:
- Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
-
startPreciseCoverage
CompletableFuture<Double> startPreciseCoverage(Boolean callCount, Boolean detailed, Boolean allowTriggeredUpdates) 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
- Collect accurate call counts beyond simple 'covered' or 'not covered'.detailed
- Collect block-based coverage.allowTriggeredUpdates
- Allow the backend to send updates on its own initiative- Returns:
- Monotonically increasing time (in seconds) when the coverage update was taken in the backend.
-
startTypeProfile
CompletableFuture<Void> startTypeProfile()Enable type profile. -
stop
CompletableFuture<Profile> stop() -
stopPreciseCoverage
CompletableFuture<Void> stopPreciseCoverage()Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. -
stopTypeProfile
CompletableFuture<Void> stopTypeProfile()Disable type profile. Disabling releases type profile data collected so far. -
takePreciseCoverage
CompletableFuture<TakePreciseCoverageResult> takePreciseCoverage()Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started.- Returns:
- TakePreciseCoverageResult
-
takeTypeProfile
CompletableFuture<List<ScriptTypeProfile>> takeTypeProfile()Collect type profile.- Returns:
- Type profile for all scripts since startTypeProfile() was turned on.
-