Tungsten v0.1.0 Tungsten.CDP.Memory View Source

Memory

This domain has no documentation

Link to this section Summary

Link to this section Types

Link to this type

cdp_module_type() View Source
cdp_module_type() :: %{
  name: String.t(),
  uuid: String.t(),
  base_address: String.t(),
  size: integer() | float()
}

Memory.Module

Executable module information

Link to this type

cdp_pressure_level_type() View Source
cdp_pressure_level_type() :: :critical | :moderate

Memory.PressureLevel

Memory pressure level.

Link to this type

cdp_sampling_profile_node_type() View Source
cdp_sampling_profile_node_type() :: %{
  size: integer() | float(),
  total: integer() | float(),
  stack: [String.t()]
}

Memory.SamplingProfileNode

Heap profile sample.

Link to this type

cdp_sampling_profile_type() View Source
cdp_sampling_profile_type() :: %{
  samples: [cdp_sampling_profile_node_type()],
  modules: [cdp_module_type()]
}

Memory.SamplingProfile

Array of heap profile samples.

Link to this section Functions

Link to this function

forcibly_purge_java_script_memory(session, parameters \\ %{}, options \\ []) View Source
forcibly_purge_java_script_memory(
  GenServer.server(),
  map(),
  Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}

Memory.forciblyPurgeJavaScriptMemory

Simulate OomIntervention by purging V8 memory.

Link to this function

get_all_time_sampling_profile(session, parameters \\ %{}, options \\ []) View Source
get_all_time_sampling_profile(
  GenServer.server(),
  map(),
  Tungsten.Connection.exec_options()
) :: {:ok, %{profile: cdp_sampling_profile_type()}} | {:error, term()}

Memory.getAllTimeSamplingProfile

Retrieve native memory allocations profile collected since renderer process startup.

Link to this function

get_browser_sampling_profile(session, parameters \\ %{}, options \\ []) View Source
get_browser_sampling_profile(
  GenServer.server(),
  map(),
  Tungsten.Connection.exec_options()
) :: {:ok, %{profile: cdp_sampling_profile_type()}} | {:error, term()}

Memory.getBrowserSamplingProfile

Retrieve native memory allocations profile collected since browser process startup.

Link to this function

get_dom_counters(session, parameters \\ %{}, options \\ []) View Source
get_dom_counters(GenServer.server(), map(), Tungsten.Connection.exec_options()) ::
  {:ok,
   %{documents: integer(), nodes: integer(), js_event_listeners: integer()}}
  | {:error, term()}

Memory.getDOMCounters

This command has no documentation

Link to this function

get_sampling_profile(session, parameters \\ %{}, options \\ []) View Source
get_sampling_profile(
  GenServer.server(),
  map(),
  Tungsten.Connection.exec_options()
) :: {:ok, %{profile: cdp_sampling_profile_type()}} | {:error, term()}

Memory.getSamplingProfile

Retrieve native memory allocations profile collected since last startSampling call.

Link to this function

prepare_for_leak_detection(session, parameters \\ %{}, options \\ []) View Source
prepare_for_leak_detection(
  GenServer.server(),
  map(),
  Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}

Memory.prepareForLeakDetection

This command has no documentation

Link to this function

set_pressure_notifications_suppressed(session, parameters, options \\ []) View Source
set_pressure_notifications_suppressed(
  GenServer.server(),
  %{suppressed: boolean()},
  Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}

Memory.setPressureNotificationsSuppressed

Enable/disable suppressing memory pressure notifications in all processes.

Link to this function

simulate_pressure_notification(session, parameters, options \\ []) View Source
simulate_pressure_notification(
  GenServer.server(),
  %{level: cdp_pressure_level_type()},
  Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}

Memory.simulatePressureNotification

Simulate a memory pressure notification in all processes.

Link to this function

start_sampling(session, parameters \\ %{}, options \\ []) View Source
start_sampling(
  GenServer.server(),
  %{
    optional(:sampling_interval) => integer(),
    optional(:suppress_randomness) => boolean()
  },
  Tungsten.Connection.exec_options()
) :: {:ok, map()} | {:error, term()}

Memory.startSampling

Start collecting native memory profile.

Link to this function

stop_sampling(session, parameters \\ %{}, options \\ []) View Source
stop_sampling(GenServer.server(), map(), Tungsten.Connection.exec_options()) ::
  {:ok, map()} | {:error, term()}

Memory.stopSampling

Stop collecting native memory profile.