lib/elastic_apm.rb
def transaction(name = nil, type = nil, context: nil, &block)
      return (block_given? ? yield : nil) unless agent

      if block_given?
        with_transaction(name, type, context: context, &block)
      else
        start_transaction(name, type, context: context)
      end
    end
# Start a new transaction or return the currently running
#
# @param name [String] A description of the transaction, eg
# `ExamplesController#index`
# @param type [String] The kind of the transaction, eg `app.request.get` or
# `db.mysql2.query`
# @param context [Context] An optional [Context]
# @yield [Transaction] Optional block encapsulating transaction
# @return [Transaction] Unless block given
# @deprecated See `with_transaction` or `start_transaction`
Start a new transaction or return the currently running
Start a new transaction or return the currently running
def transaction(name = nil, type = nil, context: nil, &block)
      return (block_given? ? yield : nil) unless agent
      if block_given?
        with_transaction(name, type, context: context, &block)
      else
        start_transaction(name, type, context: context)
      end
    end
def transaction ( name = nil , type = nil , context : nil , & block ) return ( block_given? ? yield : nil ) unless agent if block_given? with_transaction ( name , type , context : context , & block ) else start_transaction ( name , type , context : context ) end end
Start a new transaction or return the currently running
Start a new transaction or return the currently running
Unless block given
Unless block given
Transaction
name
A description of the transaction, eg `ExamplesController#index`
A description of the transaction eg ` ExamplesController#index `
type
The kind of the transaction, eg `app.request.get` or `db.mysql2.query`
The kind of the transaction eg ` app . request . get ` or ` db . mysql2 . query `
context
None
block
]
Optional block encapsulating transaction
Optional block encapsulating transaction
deprecated
See `with_transaction` or `start_transaction`
See ` with_transaction ` or ` start_transaction `