Sha256: 7f83be72e963f1bb18f3256cc2c1846e8cda8400550d17e57785440121d973a1

Contents?: true

Size: 692 Bytes

Versions: 7

Compression:

Stored size: 692 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
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
appsignal-0.7.1 spec/support/helpers/notification_helpers.rb
appsignal-0.7.1.beta.1 spec/support/helpers/notification_helpers.rb
appsignal-0.7.0.beta.1 spec/support/helpers/notification_helpers.rb
appsignal-0.7.0.alpha.4 spec/support/helpers/notification_helpers.rb
appsignal-0.7.0.alpha.3 spec/support/helpers/notification_helpers.rb
appsignal-0.7.0.alpha.2 spec/support/helpers/notification_helpers.rb
appsignal-0.7.0.alpha.1 spec/support/helpers/notification_helpers.rb