new_relic v0.1.2 NewRelic.Transaction

Records information about an instrumented web transaction.

Link to this section Summary

Types

The name of a repository action.

Elapsed time in microseconds.

The name of a model.

The name of a query.

t()

A New Relixir transaction context.

Functions

Finishes a web transaction.

Records a database query for the current web transaction.

Creates a new web transaction.

Updates the name of an existing transaction

Link to this section Types

Link to this type

action()

action() :: atom()

The name of a repository action.

Link to this type

interval()

interval() :: non_neg_integer()

Elapsed time in microseconds.

Link to this type

model()

model() :: String.t()

The name of a model.

Link to this type

query()

query() :: String.t() | {model(), action()}

The name of a query.

Link to this opaque

t()

(opaque)
t()

A New Relixir transaction context.

Link to this section Functions

Link to this function

finish(transaction)

finish(t()) :: :ok

Finishes a web transaction.

This method should be called just after processing a web transaction. It will record the elapsed time of the transaction.

Link to this function

record_db(transaction, query, elapsed)

record_db(t(), query(), interval()) :: :ok

Records a database query for the current web transaction.

The query name can either be provided as a raw string or as a tuple containing a model and action name.

Link to this function

start(name)

start(String.t()) :: t()

Creates a new web transaction.

This method should be called just before processing a web transaction.

Link to this function

update_name(transaction, new_name)

update_name(t(), String.t()) :: t()

Updates the name of an existing transaction

This method allows you to specify the name of a transaction after start to facilitate the use case where the transaction name is not known at start time.