LiveDebugger.Services.TraceService (LiveDebugger v0.1.5)

View Source

This module is responsible for accessing traces from ETS. It uses calls to CallbackTracingServer to get proper table reference.

Summary

Types

Pid is used to store mapping to table references. It identifies ETS tables managed by CallbackTracingServer

Functions

Deletes traces for LiveView or LiveComponent for given pid.

Returns existing traces of a process for the table with optional filters.

Gets a trace of process from the ETS table by id.

Inserts a new trace into the ETS table.

Types

ets_continuation()

@type ets_continuation() :: term()

ets_elem()

@type ets_elem() :: {integer(), LiveDebugger.Structs.Trace.t()}

ets_table_id()

@type ets_table_id() :: pid()

Pid is used to store mapping to table references. It identifies ETS tables managed by CallbackTracingServer

Functions

clear_traces(pid, node_id)

@spec clear_traces(
  pid :: ets_table_id(),
  node_id :: pid() | LiveDebugger.CommonTypes.cid()
) :: true

Deletes traces for LiveView or LiveComponent for given pid.

  • node_id - PID or CID which identifies node

existing_traces(pid, opts \\ [])

@spec existing_traces(pid :: ets_table_id(), opts :: keyword()) ::
  {[LiveDebugger.Structs.Trace.t()], ets_continuation()} | :end_of_table

Returns existing traces of a process for the table with optional filters.

Options

  • :node_id - PID or CID to filter traces by
  • :limit - Maximum number of traces to return (default: 100)
  • :cont - Used to get next page of items in the following queries
  • :functions - List of function names to filter traces by

get(pid, id)

@spec get(pid :: ets_table_id(), id :: integer()) ::
  LiveDebugger.Structs.Trace.t() | nil

Gets a trace of process from the ETS table by id.

insert(trace)

@spec insert(LiveDebugger.Structs.Trace.t()) :: true

Inserts a new trace into the ETS table.

to_spec(list)