Sha256: 0df9a3f2a095fed84b796488341527a57c091a0aa0c89303f2d1203fe78dac67

Contents?: true

Size: 1.01 KB

Versions: 36

Compression:

Stored size: 1.01 KB

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)
    Appsignal::Event.new(
      args[:name], args[:start], args[:ending], args[:tid], args[:payload]
    )
  end

  def create_payload(args={})
    {
      :path => '/blog',
      :action => 'show',
      :controller => 'BlogPostsController',
      :params => {
        'controller' => 'blog_posts',
        'action' => 'show',
        'id' => '1'
      },
      :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.0,
    }.merge(args)
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
appsignal-0.11.18 spec/support/helpers/notification_helpers.rb
appsignal-0.11.17 spec/support/helpers/notification_helpers.rb
appsignal-0.11.16 spec/support/helpers/notification_helpers.rb
appsignal-0.11.15 spec/support/helpers/notification_helpers.rb
appsignal-0.11.14 spec/support/helpers/notification_helpers.rb
appsignal-0.11.14.beta.1 spec/support/helpers/notification_helpers.rb
appsignal-0.11.13 spec/support/helpers/notification_helpers.rb
appsignal-0.11.13.beta.4 spec/support/helpers/notification_helpers.rb
appsignal-0.11.13.beta.3 spec/support/helpers/notification_helpers.rb
appsignal-0.11.13.beta.2 spec/support/helpers/notification_helpers.rb
appsignal-0.11.13.beta.1 spec/support/helpers/notification_helpers.rb
appsignal-0.11.13.beta.0 spec/support/helpers/notification_helpers.rb
appsignal-0.11.12 spec/support/helpers/notification_helpers.rb
appsignal-0.11.11 spec/support/helpers/notification_helpers.rb
appsignal-0.11.10 spec/support/helpers/notification_helpers.rb
appsignal-0.11.10.beta.2 spec/support/helpers/notification_helpers.rb
appsignal-0.11.10.beta.1 spec/support/helpers/notification_helpers.rb
appsignal-0.11.9 spec/support/helpers/notification_helpers.rb
appsignal-0.11.8.beta.4 spec/support/helpers/notification_helpers.rb
appsignal-0.11.8.beta.3 spec/support/helpers/notification_helpers.rb