memory

package
v0.0.0-...-b9fffb6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2025 License: MIT Imports: 4 Imported by: 4

Documentation

Overview

Package memory provides the Chrome DevTools Protocol commands, types, and events for the Memory domain.

Generated by the cdproto-gen command.

Index

Constants

View Source
const (
	CommandGetDOMCounters                     = "Memory.getDOMCounters"
	CommandGetDOMCountersForLeakDetection     = "Memory.getDOMCountersForLeakDetection"
	CommandPrepareForLeakDetection            = "Memory.prepareForLeakDetection"
	CommandForciblyPurgeJavaScriptMemory      = "Memory.forciblyPurgeJavaScriptMemory"
	CommandSetPressureNotificationsSuppressed = "Memory.setPressureNotificationsSuppressed"
	CommandSimulatePressureNotification       = "Memory.simulatePressureNotification"
	CommandStartSampling                      = "Memory.startSampling"
	CommandStopSampling                       = "Memory.stopSampling"
	CommandGetAllTimeSamplingProfile          = "Memory.getAllTimeSamplingProfile"
	CommandGetBrowserSamplingProfile          = "Memory.getBrowserSamplingProfile"
	CommandGetSamplingProfile                 = "Memory.getSamplingProfile"
)

Command names.

Variables

This section is empty.

Functions

This section is empty.

Types

type DOMCounter

type DOMCounter struct {
	Name  string `json:"name"`  // Object name. Note: object names should be presumed volatile and clients should not expect the returned names to be consistent across runs.
	Count int64  `json:"count"` // Object count.
}

DOMCounter DOM object counter data.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#type-DOMCounter

type ForciblyPurgeJavaScriptMemoryParams

type ForciblyPurgeJavaScriptMemoryParams struct{}

ForciblyPurgeJavaScriptMemoryParams simulate OomIntervention by purging V8 memory.

func ForciblyPurgeJavaScriptMemory

func ForciblyPurgeJavaScriptMemory() *ForciblyPurgeJavaScriptMemoryParams

ForciblyPurgeJavaScriptMemory simulate OomIntervention by purging V8 memory.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-forciblyPurgeJavaScriptMemory

func (*ForciblyPurgeJavaScriptMemoryParams) Do

Do executes Memory.forciblyPurgeJavaScriptMemory against the provided context.

type GetAllTimeSamplingProfileParams

type GetAllTimeSamplingProfileParams struct{}

GetAllTimeSamplingProfileParams retrieve native memory allocations profile collected since renderer process startup.

func GetAllTimeSamplingProfile

func GetAllTimeSamplingProfile() *GetAllTimeSamplingProfileParams

GetAllTimeSamplingProfile retrieve native memory allocations profile collected since renderer process startup.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-getAllTimeSamplingProfile

func (*GetAllTimeSamplingProfileParams) Do

Do executes Memory.getAllTimeSamplingProfile against the provided context.

returns:

profile

type GetAllTimeSamplingProfileReturns

type GetAllTimeSamplingProfileReturns struct {
	Profile *SamplingProfile `json:"profile,omitempty,omitzero"`
}

GetAllTimeSamplingProfileReturns return values.

type GetBrowserSamplingProfileParams

type GetBrowserSamplingProfileParams struct{}

GetBrowserSamplingProfileParams retrieve native memory allocations profile collected since browser process startup.

func GetBrowserSamplingProfile

func GetBrowserSamplingProfile() *GetBrowserSamplingProfileParams

GetBrowserSamplingProfile retrieve native memory allocations profile collected since browser process startup.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-getBrowserSamplingProfile

func (*GetBrowserSamplingProfileParams) Do

Do executes Memory.getBrowserSamplingProfile against the provided context.

returns:

profile

type GetBrowserSamplingProfileReturns

type GetBrowserSamplingProfileReturns struct {
	Profile *SamplingProfile `json:"profile,omitempty,omitzero"`
}

GetBrowserSamplingProfileReturns return values.

type GetDOMCountersForLeakDetectionParams

type GetDOMCountersForLeakDetectionParams struct{}

GetDOMCountersForLeakDetectionParams retruns DOM object counters after preparing renderer for leak detection.

func GetDOMCountersForLeakDetection

func GetDOMCountersForLeakDetection() *GetDOMCountersForLeakDetectionParams

GetDOMCountersForLeakDetection retruns DOM object counters after preparing renderer for leak detection.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-getDOMCountersForLeakDetection

func (*GetDOMCountersForLeakDetectionParams) Do

Do executes Memory.getDOMCountersForLeakDetection against the provided context.

returns:

counters - DOM object counters.

type GetDOMCountersForLeakDetectionReturns

type GetDOMCountersForLeakDetectionReturns struct {
	Counters []*DOMCounter `json:"counters,omitempty,omitzero"` // DOM object counters.
}

GetDOMCountersForLeakDetectionReturns return values.

type GetDOMCountersParams

type GetDOMCountersParams struct{}

GetDOMCountersParams retruns current DOM object counters.

func GetDOMCounters

func GetDOMCounters() *GetDOMCountersParams

GetDOMCounters retruns current DOM object counters.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-getDOMCounters

func (*GetDOMCountersParams) Do

func (p *GetDOMCountersParams) Do(ctx context.Context) (documents int64, nodes int64, jsEventListeners int64, err error)

Do executes Memory.getDOMCounters against the provided context.

returns:

documents
nodes
jsEventListeners

type GetDOMCountersReturns

type GetDOMCountersReturns struct {
	Documents        int64 `json:"documents,omitempty,omitzero"`
	Nodes            int64 `json:"nodes,omitempty,omitzero"`
	JsEventListeners int64 `json:"jsEventListeners,omitempty,omitzero"`
}

GetDOMCountersReturns return values.

type GetSamplingProfileParams

type GetSamplingProfileParams struct{}

GetSamplingProfileParams retrieve native memory allocations profile collected since last startSampling call.

func GetSamplingProfile

func GetSamplingProfile() *GetSamplingProfileParams

GetSamplingProfile retrieve native memory allocations profile collected since last startSampling call.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-getSamplingProfile

func (*GetSamplingProfileParams) Do

func (p *GetSamplingProfileParams) Do(ctx context.Context) (profile *SamplingProfile, err error)

Do executes Memory.getSamplingProfile against the provided context.

returns:

profile

type GetSamplingProfileReturns

type GetSamplingProfileReturns struct {
	Profile *SamplingProfile `json:"profile,omitempty,omitzero"`
}

GetSamplingProfileReturns return values.

type Module

type Module struct {
	Name        string  `json:"name"`        // Name of the module.
	UUID        string  `json:"uuid"`        // UUID of the module.
	BaseAddress string  `json:"baseAddress"` // Base address where the module is loaded into memory. Encoded as a decimal or hexadecimal (0x prefixed) string.
	Size        float64 `json:"size"`        // Size of the module in bytes.
}

Module executable module information.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#type-Module

type PrepareForLeakDetectionParams

type PrepareForLeakDetectionParams struct{}

PrepareForLeakDetectionParams prepares for leak detection by terminating workers, stopping spellcheckers, dropping non-essential internal caches, running garbage collections, etc.

func PrepareForLeakDetection

func PrepareForLeakDetection() *PrepareForLeakDetectionParams

PrepareForLeakDetection prepares for leak detection by terminating workers, stopping spellcheckers, dropping non-essential internal caches, running garbage collections, etc.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-prepareForLeakDetection

func (*PrepareForLeakDetectionParams) Do

Do executes Memory.prepareForLeakDetection against the provided context.

type PressureLevel

type PressureLevel string

PressureLevel memory pressure level.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#type-PressureLevel

const (
	PressureLevelModerate PressureLevel = "moderate"
	PressureLevelCritical PressureLevel = "critical"
)

PressureLevel values.

func (PressureLevel) String

func (t PressureLevel) String() string

String returns the PressureLevel as string value.

func (*PressureLevel) UnmarshalJSON

func (t *PressureLevel) UnmarshalJSON(buf []byte) error

UnmarshalJSON satisfies [json.Unmarshaler].

type SamplingProfile

type SamplingProfile struct {
	Samples []*SamplingProfileNode `json:"samples"`
	Modules []*Module              `json:"modules"`
}

SamplingProfile array of heap profile samples.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#type-SamplingProfile

type SamplingProfileNode

type SamplingProfileNode struct {
	Size  float64  `json:"size"`  // Size of the sampled allocation.
	Total float64  `json:"total"` // Total bytes attributed to this sample.
	Stack []string `json:"stack"` // Execution stack at the point of allocation.
}

SamplingProfileNode heap profile sample.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#type-SamplingProfileNode

type SetPressureNotificationsSuppressedParams

type SetPressureNotificationsSuppressedParams struct {
	Suppressed bool `json:"suppressed"` // If true, memory pressure notifications will be suppressed.
}

SetPressureNotificationsSuppressedParams enable/disable suppressing memory pressure notifications in all processes.

func SetPressureNotificationsSuppressed

func SetPressureNotificationsSuppressed(suppressed bool) *SetPressureNotificationsSuppressedParams

SetPressureNotificationsSuppressed enable/disable suppressing memory pressure notifications in all processes.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-setPressureNotificationsSuppressed

parameters:

suppressed - If true, memory pressure notifications will be suppressed.

func (*SetPressureNotificationsSuppressedParams) Do

Do executes Memory.setPressureNotificationsSuppressed against the provided context.

type SimulatePressureNotificationParams

type SimulatePressureNotificationParams struct {
	Level PressureLevel `json:"level"` // Memory pressure level of the notification.
}

SimulatePressureNotificationParams simulate a memory pressure notification in all processes.

func SimulatePressureNotification

func SimulatePressureNotification(level PressureLevel) *SimulatePressureNotificationParams

SimulatePressureNotification simulate a memory pressure notification in all processes.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-simulatePressureNotification

parameters:

level - Memory pressure level of the notification.

func (*SimulatePressureNotificationParams) Do

Do executes Memory.simulatePressureNotification against the provided context.

type StartSamplingParams

type StartSamplingParams struct {
	SamplingInterval   int64 `json:"samplingInterval,omitempty,omitzero"`   // Average number of bytes between samples.
	SuppressRandomness bool  `json:"suppressRandomness,omitempty,omitzero"` // Do not randomize intervals between samples.
}

StartSamplingParams start collecting native memory profile.

func StartSampling

func StartSampling() *StartSamplingParams

StartSampling start collecting native memory profile.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-startSampling

parameters:

func (*StartSamplingParams) Do

func (p *StartSamplingParams) Do(ctx context.Context) (err error)

Do executes Memory.startSampling against the provided context.

func (StartSamplingParams) WithSamplingInterval

func (p StartSamplingParams) WithSamplingInterval(samplingInterval int64) *StartSamplingParams

WithSamplingInterval average number of bytes between samples.

func (StartSamplingParams) WithSuppressRandomness

func (p StartSamplingParams) WithSuppressRandomness(suppressRandomness bool) *StartSamplingParams

WithSuppressRandomness do not randomize intervals between samples.

type StopSamplingParams

type StopSamplingParams struct{}

StopSamplingParams stop collecting native memory profile.

func StopSampling

func StopSampling() *StopSamplingParams

StopSampling stop collecting native memory profile.

See: https://chromedevtools.github.io/devtools-protocol/tot/Memory#method-stopSampling

func (*StopSamplingParams) Do

func (p *StopSamplingParams) Do(ctx context.Context) (err error)

Do executes Memory.stopSampling against the provided context.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL