Table of Contents

Interface IHeapProfiler

Namespace
Selenium.WebDriver.BiDi.Cdp.HeapProfiler
Assembly
Selenium.WebDriver.BiDi.Cdp.dll
[Experimental("BIDICDP001")]
public interface IHeapProfiler

Properties

AddHeapSnapshotChunk

IEventSource<AddHeapSnapshotChunkEventArgs> AddHeapSnapshotChunk { get; }

Property Value

IEventSource<AddHeapSnapshotChunkEventArgs>

Remarks

Event args (AddHeapSnapshotChunkEventArgs):

  • Chunk

HeapStatsUpdate

If heap objects tracking has been started then backend may send update for one or more fragments

IEventSource<HeapStatsUpdateEventArgs> HeapStatsUpdate { get; }

Property Value

IEventSource<HeapStatsUpdateEventArgs>

Remarks

Event args (HeapStatsUpdateEventArgs):

  • StatsUpdate - An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment.

LastSeenObjectId

If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event.

IEventSource<LastSeenObjectIdEventArgs> LastSeenObjectId { get; }

Property Value

IEventSource<LastSeenObjectIdEventArgs>

Remarks

Event args (LastSeenObjectIdEventArgs):

  • LastSeenObjectId
  • Timestamp

ReportHeapSnapshotProgress

IEventSource<ReportHeapSnapshotProgressEventArgs> ReportHeapSnapshotProgress { get; }

Property Value

IEventSource<ReportHeapSnapshotProgressEventArgs>

Remarks

Event args (ReportHeapSnapshotProgressEventArgs):

  • Done
  • Total
  • Finished

ResetProfiles

IEventSource<ResetProfilesEventArgs> ResetProfiles { get; }

Property Value

IEventSource<ResetProfilesEventArgs>

Methods

AddInspectedHeapObjectAsync(HeapSnapshotObjectId, string?, CancellationToken)

Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions).

Task<AddInspectedHeapObjectResult> AddInspectedHeapObjectAsync(HeapSnapshotObjectId heapObjectId, string? session = null, CancellationToken cancellationToken = default)

Parameters

heapObjectId HeapSnapshotObjectId

Heap snapshot object id to be accessible by means of $x command line API.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<AddInspectedHeapObjectResult>

A task representing the asynchronous operation, containing a AddInspectedHeapObjectResult.

CollectGarbageAsync(string?, CancellationToken)

Task<CollectGarbageResult> CollectGarbageAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<CollectGarbageResult>

A task representing the asynchronous operation, containing a CollectGarbageResult.

DisableAsync(string?, CancellationToken)

Task<DisableResult> DisableAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<DisableResult>

A task representing the asynchronous operation, containing a DisableResult.

EnableAsync(string?, CancellationToken)

Task<EnableResult> EnableAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<EnableResult>

A task representing the asynchronous operation, containing a EnableResult.

GetHeapObjectIdAsync(RemoteObjectId, string?, CancellationToken)

Task<GetHeapObjectIdResult> GetHeapObjectIdAsync(RemoteObjectId objectId, string? session = null, CancellationToken cancellationToken = default)

Parameters

objectId RemoteObjectId

Identifier of the object to get heap object id for.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetHeapObjectIdResult>

A task representing the asynchronous operation, containing a GetHeapObjectIdResult.

GetObjectByHeapObjectIdAsync(HeapSnapshotObjectId, string?, string?, CancellationToken)

Task<GetObjectByHeapObjectIdResult> GetObjectByHeapObjectIdAsync(HeapSnapshotObjectId objectId, string? objectGroup = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

objectId HeapSnapshotObjectId
objectGroup string

Symbolic group name that can be used to release multiple objects.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetObjectByHeapObjectIdResult>

A task representing the asynchronous operation, containing a GetObjectByHeapObjectIdResult.

GetSamplingProfileAsync(string?, CancellationToken)

Task<GetSamplingProfileResult> GetSamplingProfileAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<GetSamplingProfileResult>

A task representing the asynchronous operation, containing a GetSamplingProfileResult.

StartSamplingAsync(double?, double?, bool?, bool?, string?, CancellationToken)

Task<StartSamplingResult> StartSamplingAsync(double? samplingInterval = null, double? stackDepth = null, bool? includeObjectsCollectedByMajorGC = null, bool? includeObjectsCollectedByMinorGC = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

samplingInterval double?

Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes.

stackDepth double?

Maximum stack depth. The default value is 128.

includeObjectsCollectedByMajorGC bool?

By default, the sampling heap profiler reports only objects which are still alive when the profile is returned via getSamplingProfile or stopSampling, which is useful for determining what functions contribute the most to steady-state memory usage. This flag instructs the sampling heap profiler to also include information about objects discarded by major GC, which will show which functions cause large temporary memory usage or long GC pauses.

includeObjectsCollectedByMinorGC bool?

By default, the sampling heap profiler reports only objects which are still alive when the profile is returned via getSamplingProfile or stopSampling, which is useful for determining what functions contribute the most to steady-state memory usage. This flag instructs the sampling heap profiler to also include information about objects discarded by minor GC, which is useful when tuning a latency-sensitive application for minimal GC activity.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<StartSamplingResult>

A task representing the asynchronous operation, containing a StartSamplingResult.

StartTrackingHeapObjectsAsync(bool?, string?, CancellationToken)

Task<StartTrackingHeapObjectsResult> StartTrackingHeapObjectsAsync(bool? trackAllocations = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

trackAllocations bool?
session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<StartTrackingHeapObjectsResult>

A task representing the asynchronous operation, containing a StartTrackingHeapObjectsResult.

StopSamplingAsync(string?, CancellationToken)

Task<StopSamplingResult> StopSamplingAsync(string? session = null, CancellationToken cancellationToken = default)

Parameters

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<StopSamplingResult>

A task representing the asynchronous operation, containing a StopSamplingResult.

StopTrackingHeapObjectsAsync(bool?, bool?, bool?, bool?, string?, CancellationToken)

Task<StopTrackingHeapObjectsResult> StopTrackingHeapObjectsAsync(bool? reportProgress = null, bool? treatGlobalObjectsAsRoots = null, bool? captureNumericValue = null, bool? exposeInternals = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

reportProgress bool?

If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped.

treatGlobalObjectsAsRoots bool?

Deprecated in favor of exposeInternals.

captureNumericValue bool?

If true, numerical values are included in the snapshot

exposeInternals bool?

If true, exposes internals of the snapshot.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<StopTrackingHeapObjectsResult>

A task representing the asynchronous operation, containing a StopTrackingHeapObjectsResult.

TakeHeapSnapshotAsync(bool?, bool?, bool?, bool?, string?, CancellationToken)

Task<TakeHeapSnapshotResult> TakeHeapSnapshotAsync(bool? reportProgress = null, bool? treatGlobalObjectsAsRoots = null, bool? captureNumericValue = null, bool? exposeInternals = null, string? session = null, CancellationToken cancellationToken = default)

Parameters

reportProgress bool?

If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken.

treatGlobalObjectsAsRoots bool?

If true, a raw snapshot without artificial roots will be generated. Deprecated in favor of exposeInternals.

captureNumericValue bool?

If true, numerical values are included in the snapshot

exposeInternals bool?

If true, exposes internals of the snapshot.

session string

Optional CDP session override.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

Task<TakeHeapSnapshotResult>

A task representing the asynchronous operation, containing a TakeHeapSnapshotResult.