class NewRelic::Transaction
- NewRelic::Transaction
- Reference
- Object
Overview
A NewRelic::Transaction encapsulates a call to either the NewRelicExt::start_web_transaction or the NewRelicExt::start_non_web_transaction functions, and all of the data management around it.
Direct Known Subclasses
Defined in:
new_relic/transaction.crConstructors
Class Method Summary
-
.create(app, label, type = :web)
Instead of directly creating a Transaction object with a specified type (:web or :nonweb), one can call #create with an appropriate type parameter and one will get back the subclass which corresponds to that type, either WebTransaction, or NonWebTransaction.
Instance Method Summary
- #[]=(k : String, v : Int)
- #app : NewRelic
- #custom_event(event_type : String, **params)
-
#destroy!
Get rid of the data structures associated with this transaction.
- #error(msg : String = "Error at #{caller[1]}", category : String = "error", priority : Int16 = 0)
-
#ignore!
This transaction will be ignored, and the data that it contains will not be sent to New Relic.
- #name=(val : String)
-
#pointer : Pointer(NewRelicExt::TxnT)
Return a pointer to the Transaction.
- #segment(params : NewRelic::Segment::DatastoreParams | NewRelic::Segment::ExternalParams, &blk : Segment -> )
- #segment(label : String = "segment", category : String = "segment", &blk : Segment -> )
- #segment(**params, &blk : Segment -> )
-
#structure : NewRelicExt::TxnT
Return the corresponding C structure for this transaction.
- #timing(start_time, duration)
- #type : Symbol
Constructor Detail
Class Method Detail
Instead of directly creating a Transaction object with a specified type (:web or :nonweb), one can call #create with an appropriate type parameter and one will get back the subclass which corresponds to that type, either WebTransaction, or NonWebTransaction.
Instance Method Detail
Get rid of the data structures associated with this transaction. This class must be called before letting this object be garbage collected in order to avoid a memory leak. The easiest way to do this is to use the block based transaction support, as that will ensure that this method is called and that these resources are destroyed.
This transaction will be ignored, and the data that it contains will not be sent to New Relic.