class Object

Public Instance Methods

dispatch!(*args, &block) click to toggle source
# File lib/tracebin/patches/sinatra.rb, line 4
def dispatch!(*args, &block)
  start_time = ::Tracebin::PatchHelper.timestamp_string
  result = dispatch_without_tracebin!(*args, *block)
  end_time = ::Tracebin::PatchHelper.timestamp_string
  route = env['sinatra.route']

  event_data = [
    'sinatra.route',
    start_time,
    end_time,
    {
      endpoint: route
    }
  ]

  ::Tracebin::Patches.handle_event :sinatra, event_data

  result
end
exec(*args, &block) click to toggle source
# File lib/tracebin/patches/postgres.rb, line 24
def exec(*args, &block)
  start_time   = ::Tracebin::PatchHelper.timestamp_string
  result       = exec_without_tracebin(*args, &block)
  end_time     = ::Tracebin::PatchHelper.timestamp_string

  event_data = [
    'sql.postgres_exec',
    start_time,
    end_time,
    {
      sql: args[0]
    }
  ]

  ::Tracebin::Patches.handle_event :postgres, event_data

  result
end
exec_params(*args, &block) click to toggle source
# File lib/tracebin/patches/postgres.rb, line 5
def exec_params(*args, &block)
  start_time   = ::Tracebin::PatchHelper.timestamp_string
  result       = exec_params_without_tracebin(*args, &block)
  end_time     = ::Tracebin::PatchHelper.timestamp_string

  event_data = [
    'sql.postgres_exec',
    start_time,
    end_time,
    {
      sql: args[0]
    }
  ]

  ::Tracebin::Patches.handle_event :postgres, event_data

  result
end
query(*args, &block) click to toggle source
# File lib/tracebin/patches/mysql2.rb, line 4
def query(*args, &block)
  start_time   = ::Tracebin::PatchHelper.timestamp_string
  result       = query_without_tracebin(*args, &block)
  end_time     = ::Tracebin::PatchHelper.timestamp_string

  event_data = [
    'sql.mysql2_query',
    start_time,
    end_time,
    {
      sql: args[0]
    }
  ]

  ::Tracebin::Patches.handle_event :mysql2, event_data

  result
end
render_with_layout(path, locals, *args, &block) click to toggle source
# File lib/tracebin/patches/action_view_layout.rb, line 4
def render_with_layout(path, locals, *args, &block)
  layout = nil

  if path
    if method(:find_layout).arity == 3
      layout = find_layout(path, locals.keys, [formats.first])
    else
      layout = find_layout(path, locals.keys)
    end
  end

  if layout
    start_time = ::Tracebin::PatchHelper.timestamp_string

    result = render_with_layout_without_tracebin(path, locals, *args, &block)

    end_time = ::Tracebin::PatchHelper.timestamp_string

    event_data = [
      'render_layout.action_view',
      start_time,
      end_time,
      {
        identifier: layout.identifier
      }
    ]

    ::Tracebin::Patches.handle_event :action_view_layout, event_data

    result
  else
    render_with_layout_without_tracebin(path, locals, *args, &block)
  end
end
run() click to toggle source
# File lib/tracebin/patches/sidekiq_health.rb, line 11
def run
  @tracebin_task = Concurrent::TimerTask.new(execution_interval: 10) do
    health = Tracebin::SystemHealthSample.new process: :worker
    ::Tracebin::Patches.handle_event :sidekiq_health, health
  end

  @tracebin_task.execute

  run_without_tracebin
end
stop() click to toggle source
# File lib/tracebin/patches/sidekiq_health.rb, line 22
def stop
  @tracebin_task.shutdown

  stop_without_tracebin
end