google-cloud-debugger - Class Google::Cloud::Debugger::BreakpointManager (v0.42.2)

Reference documentation and code samples for the google-cloud-debugger class Google::Cloud::Debugger::BreakpointManager.

BreakpointManager

Responsible for querying Stackdriver Debugger service for any active breakpoints and keep an accurate local copies of the breakpoints.

It correctly remembers which breakpoints are currently active and watched by the debugger agent, and which breakpoints are already completed. The BreakpointManager holds the record of truth for debugger breakpoints

Inherits

  • Object

Includes

  • MonitorMixin

Methods

#active_breakpoints

def active_breakpoints() -> Array<Google::Cloud::Debugger::Breakpoint>

Get a list of all active breakpoints.

Returns

#agent

def agent() -> Google::Cloud::Debugger::Agent

The debugger agent this tracer belongs to

#all_complete?

def all_complete?() -> Boolean

Check whether any active breakpoints haven't been completed yet.

Returns
  • (Boolean) — True if no more active breakpoints are left. False otherwise.

#app_root

def app_root() -> String

Application root directory, in absolute file path form.

Returns
  • (String)

#breakpoint_hit

def breakpoint_hit(breakpoint, call_stack_bindings)

Evaluates a hit breakpoint, and submit the breakpoint to Transmitter if this breakpoint is evaluated successfully.

See Snappoint#evaluate and Logpoint#evaluate for evaluation details.

Parameters
  • breakpoint (Google::Cloud::Debugger::Breakpoint) — The breakpoint to be evaluated
  • call_stack_bindings (Array<Binding>) — An array of Ruby Binding objects, from the each frame of the call stack that leads to the triggering of the breakpoints.

#breakpoints

def breakpoints() -> Array<Google::Cloud::Debugger::Breakpoint>

Get a list of all breakpoints, both active and completed.

Returns

#clear_breakpoints

def clear_breakpoints()

Clear local breakpoints cache. Remove all active and completed breakpoints

#completed_breakpoints

def completed_breakpoints() -> Array<Google::Cloud::Debugger::Breakpoint>

Get a list of all completed breakpoints.

Returns

#log_logpoint

def log_logpoint(logpoint)

Assume the given logpoint is successfully evaluated, log the evaluated log message via logger

Parameter

#mark_off

def mark_off(breakpoint) -> Google::Cloud::Debugger::Breakpoint, NilClass

Mark a given active breakpoint as completed. Meaning moving it from list of active breakpoints to completed breakpoints.

Parameter
Returns
  • (Google::Cloud::Debugger::Breakpoint, NilClass) — The same breakpoint if successfully marked off as completed. Nil if this breakpoint isn't found in the list of active breakpoints or failed to mark off as completed.

#on_breakpoints_change

def on_breakpoints_change() -> Method

Callback function invoked when new breakpoints are added or removed

Returns
  • (Method)

#on_breakpoints_change=

def on_breakpoints_change=(value) -> Method

Callback function invoked when new breakpoints are added or removed

Parameter
  • value (Method)
Returns
  • (Method)

#sync_active_breakpoints

def sync_active_breakpoints(debuggee_id) -> Boolean

Sync active breakpoints with Stackdriver Debugger service for a given debuggee application. Each request to the debugger service returns the full list of all active breakpoints. This method makes sure the local cache of active breakpoints is consistent with server breakpoints set.

Parameter
  • debuggee_id (String) — Debuggee application ID
Returns
  • (Boolean) — True if synced successfully; otherwise false.

#update_breakpoints

def update_breakpoints(server_breakpoints)

Update the local breakpoints cache with a list of server active breakpoints. New breakpoints will be added to local cache, and deleted breakpoints will be removed from local cache.

It also correctly identifies evaluated active breakpoints from the server set of breakpoints, and does not re-add such evaluated breakpoints to the active list again.

Parameter