Module: PaperTrailDiff::Instrumentation

Defined in:
lib/paper_trail_diff/instrumentation.rb,
sig/generated/paper_trail_diff/instrumentation.rbs

Overview

Emits quiet, namespaced runtime events for application-owned diagnostics.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.comparison_payload(association_paths:, reload_live_endpoints:) ⇒ Object

Signature:

  • (association_paths: Array[String], reload_live_endpoints: bool) -> Hash[Symbol, untyped]



31
32
33
34
35
36
# File 'lib/paper_trail_diff/instrumentation.rb', line 31

def comparison_payload(association_paths:, reload_live_endpoints:)
  {
    association_paths: association_paths,
    reload_live_endpoints: reload_live_endpoints
  }
end

.instrument(event, payload) ⇒ Object

Signature:

  • (String | Symbol, Hash[Symbol, untyped]) { () -> untyped } -> untyped



12
13
14
15
16
17
18
19
20
# File 'lib/paper_trail_diff/instrumentation.rb', line 12

def instrument(event, payload, &)
  active_support = Object.const_get(:ActiveSupport) #: untyped
  notifications = active_support.const_get(:Notifications) #: untyped
  notifications.instrument(
    "#{event}.paper_trail_diff",
    payload,
    &
  )
end

.notify(event, payload) ⇒ Object

Reports a condition rather than timing work: nothing failed, but the result may be incomplete and only the application can judge that.

Signature:

  • (String | Symbol, Hash[Symbol, untyped]) -> void



25
26
27
28
# File 'lib/paper_trail_diff/instrumentation.rb', line 25

def notify(event, payload)
  instrument(event, payload) { nil }
  nil
end

Instance Method Details

#self?.comparison_payloadHash[Symbol, untyped]

: (association_paths: Array, reload_live_endpoints: bool) -> Hash[Symbol, untyped]

Parameters:

  • association_paths: (Array[String])
  • reload_live_endpoints: (Boolean)

Returns:

  • (Hash[Symbol, untyped])


15
# File 'sig/generated/paper_trail_diff/instrumentation.rbs', line 15

def self?.comparison_payload: (association_paths: Array[String], reload_live_endpoints: bool) -> Hash[Symbol, untyped]

#self?.instrument { ... } ⇒ Object

: (String | Symbol, Hash[Symbol, untyped]) { () -> untyped } -> untyped

Parameters:

  • (String, Symbol)
  • (Hash[Symbol, untyped])

Yields:

Yield Returns:

  • (Object)

Returns:

  • (Object)


7
# File 'sig/generated/paper_trail_diff/instrumentation.rbs', line 7

def self?.instrument: (String | Symbol, Hash[Symbol, untyped]) { () -> untyped } -> untyped

#self?.notifyvoid

This method returns an undefined value.

Reports a condition rather than timing work: nothing failed, but the result may be incomplete and only the application can judge that. : (String | Symbol, Hash[Symbol, untyped]) -> void

Parameters:

  • (String, Symbol)
  • (Hash[Symbol, untyped])


12
# File 'sig/generated/paper_trail_diff/instrumentation.rbs', line 12

def self?.notify: (String | Symbol, Hash[Symbol, untyped]) -> void