Table of Contents

Class ProfilerAdapter

Namespace
OpenQA.Selenium.DevTools.V148.Profiler
Assembly
Selenium.WebDriver.dll

Represents an adapter for the Profiler domain to simplify the command interface.

public class ProfilerAdapter
Inheritance
ProfilerAdapter
Inherited Members

Constructors

ProfilerAdapter(IDevToolsSession)

Initializes a new instance of the ProfilerAdapter class.

public ProfilerAdapter(IDevToolsSession session)

Parameters

session IDevToolsSession

The IDevToolsSession to be used with this adapter.

Exceptions

ArgumentNullException

If session is null.

Properties

Session

Gets the DevToolsSession associated with the adapter.

public IDevToolsSession Session { get; }

Property Value

IDevToolsSession

Methods

Disable(DisableCommandSettings?, CancellationToken, int?, bool)

disable

public Task<DisableCommandResponse?> Disable(DisableCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command DisableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<DisableCommandResponse>

Enable(EnableCommandSettings?, CancellationToken, int?, bool)

enable

public Task<EnableCommandResponse?> Enable(EnableCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command EnableCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<EnableCommandResponse>

GetBestEffortCoverage(GetBestEffortCoverageCommandSettings?, CancellationToken, int?, bool)

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

public Task<GetBestEffortCoverageCommandResponse> GetBestEffortCoverage(GetBestEffortCoverageCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command GetBestEffortCoverageCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<GetBestEffortCoverageCommandResponse>

SetSamplingInterval(SetSamplingIntervalCommandSettings, CancellationToken, int?, bool)

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

public Task<SetSamplingIntervalCommandResponse?> SetSamplingInterval(SetSamplingIntervalCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command SetSamplingIntervalCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<SetSamplingIntervalCommandResponse>

Start(StartCommandSettings?, CancellationToken, int?, bool)

start

public Task<StartCommandResponse?> Start(StartCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command StartCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<StartCommandResponse>

StartPreciseCoverage(StartPreciseCoverageCommandSettings, CancellationToken, int?, bool)

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.

public Task<StartPreciseCoverageCommandResponse> StartPreciseCoverage(StartPreciseCoverageCommandSettings command, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command StartPreciseCoverageCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<StartPreciseCoverageCommandResponse>

Stop(StopCommandSettings?, CancellationToken, int?, bool)

stop

public Task<StopCommandResponse> Stop(StopCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command StopCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<StopCommandResponse>

StopPreciseCoverage(StopPreciseCoverageCommandSettings?, CancellationToken, int?, bool)

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

public Task<StopPreciseCoverageCommandResponse?> StopPreciseCoverage(StopPreciseCoverageCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command StopPreciseCoverageCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<StopPreciseCoverageCommandResponse>

TakePreciseCoverage(TakePreciseCoverageCommandSettings?, CancellationToken, int?, bool)

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

public Task<TakePreciseCoverageCommandResponse> TakePreciseCoverage(TakePreciseCoverageCommandSettings? command = null, CancellationToken cancellationToken = default, int? millisecondsTimeout = null, bool throwExceptionIfResponseNotReceived = true)

Parameters

command TakePreciseCoverageCommandSettings
cancellationToken CancellationToken
millisecondsTimeout int?
throwExceptionIfResponseNotReceived bool

Returns

Task<TakePreciseCoverageCommandResponse>

Events

ConsoleProfileFinished

consoleProfileFinished

public event EventHandler<ConsoleProfileFinishedEventArgs>? ConsoleProfileFinished

Event Type

EventHandler<ConsoleProfileFinishedEventArgs>

ConsoleProfileStarted

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

public event EventHandler<ConsoleProfileStartedEventArgs>? ConsoleProfileStarted

Event Type

EventHandler<ConsoleProfileStartedEventArgs>

PreciseCoverageDeltaUpdate

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 immediately at a certain point in time.

public event EventHandler<PreciseCoverageDeltaUpdateEventArgs>? PreciseCoverageDeltaUpdate

Event Type

EventHandler<PreciseCoverageDeltaUpdateEventArgs>