Sha256: 451008c0f63eb26997d848ebbad8aada51e125eb20ef9cb72d861e79dab483b1

Contents?: true

Size: 933 Bytes

Versions: 3

Compression:

Stored size: 933 Bytes

Contents

module NotificationHelpers
  def notification_event(args={})
    args = {
      :name => 'process_action.action_controller',
      :start => fixed_time,
      :ending => fixed_time + 0.1,
      :tid => '1',
      :payload => create_payload
    }.merge(args)
    ActiveSupport::Notifications::Event.new(
      args[:name], args[:start], args[:ending], args[:tid], args[:payload]
    )
  end

  def create_payload(args={})
    {
      :path => '/blog',
      :action => 'show',
      :controller => 'BlogPostsController',
      :request_format => 'html',
      :request_method => "GET",
      :status => '200',
      :view_runtime => 500,
      :db_runtime => 500
    }.merge(args)
  end

  def create_background_payload(args={})
    {
      :class => 'BackgroundJob',
      :method => 'perform',
      :priority => 1,
      :attempts => 0,
      :queue => 'default',
      :queue_start => fixed_time - 10,
    }.merge(args)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
appsignal-0.8.1.beta.2 spec/support/helpers/notification_helpers.rb
appsignal-0.8.1.beta.1 spec/support/helpers/notification_helpers.rb
appsignal-0.8.1.beta.0 spec/support/helpers/notification_helpers.rb