Sha256: b1a44404fafe038720f45b3d01b47d8f519d9344234ac3523c6c8a951775dbdc

Contents?: true

Size: 729 Bytes

Versions: 1

Compression:

Stored size: 729 Bytes

Contents

module NotificationHelpers

  def notification_event(args={})
    time = Time.parse('01-01-2001 10:01:00')
    args = {
      :name => 'process_action.action_controller',
      :start => time,
      :ending => time + 0.100,
      :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

1 entries across 1 versions & 1 rubygems

Version Path
appsignal-0.5.0 spec/support/helpers/notification_helpers.rb