class NewRelic::Transaction

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.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(app : NewRelic, label : String = "transaction", type : Symbol = :web) #

[View source]

Class Method Detail

def self.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.


[View source]

Instance Method Detail

def []=(k : String, v : Int) #

[View source]
def app : NewRelic #

[View source]
def custom_event(event_type : String, **params) #

[View source]
def destroy! #

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.


[View source]
def error(msg : String = "Error at #{caller[1]}", category : String = "error", priority : Int16 = 0) #

[View source]
def ignore! #

This transaction will be ignored, and the data that it contains will not be sent to New Relic.


[View source]
def name=(val : String) #

[View source]
def pointer : Pointer(NewRelicExt::TxnT) #

Return a pointer to the Transaction.


[View source]

[View source]
def segment(label : String = "segment", category : String = "segment", &blk : Segment -> ) #

[View source]
def segment(**params, &blk : Segment -> ) #

[View source]
def structure : NewRelicExt::TxnT #

Return the corresponding C structure for this transaction.


[View source]
def timing(start_time, duration) #

[View source]
def type : Symbol #

[View source]