Class: SolidObserver::CLI::Trace

Inherits:
Base
  • Object
show all
Defined in:
lib/solid_observer/cli/trace.rb

Constant Summary collapse

DETAIL_FORMATTERS =
{
  queue: :format_queue_details,
  cache: :format_cache_details,
  cable: :format_cable_details
}.freeze
EVENT_FORMATTERS =
{
  "cable_summary" => ->(row) { "and #{row[:collapsed_count]} more cable events" }
}.freeze

Instance Method Summary collapse

Methods inherited from Base

call

Instance Method Details

#call(correlation_id:, limit: nil) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/solid_observer/cli/trace.rb', line 16

def call(correlation_id:, limit: nil)
  return output("Trace unavailable in realtime mode.") if SolidObserver.config.realtime_mode?

  result = SolidObserver::Queries::TraceQuery.new.call(correlation_id: correlation_id, limit: limit)
  return warning("No events found for correlation_id: #{correlation_id}") if (rows = result.rows).empty?

  print_trace_table(rows)
  print_unavailable_components(result.unavailable_components)
end