class NewRelic::Segment
- NewRelic::Segment
- Reference
- Object
Overview
A NewRelic::Segment encapsulates a call to NewRelicExt.start_segment, and all of the data management around it.
Defined in:
new_relic/segment.crnew_relic/segment/datastore_params.cr
new_relic/segment/external_params.cr
Constructors
- .new(transaction : Transaction, product : String, collection : String | Nil, operation : String | Nil, host : String | Nil, port_path_or_id : String | Nil, database_name : String | Nil, query : String | Nil)
- .new(transaction : Transaction, uri : String, procedure : String | Nil, library : String | Nil)
- .new(transaction : Transaction, label : String, category : String)
Instance Method Summary
-
#destroy!
Destroy the underlying resources that were allocated for this object.
- #parent=(val)
- #parent_root!
-
#pointer : Pointer(NewRelicExt::SegmentT)
Return a pointer to the C structure that corresponds to the Segment.
- #segment : NewRelicExt::SegmentT
-
#structure : NewRelicExt::SegmentT
Return the C structure that corresponds to the Segment.
- #timing(start_time, duration)
- #transaction : Transaction
Constructor Detail
def self.new(transaction : Transaction, product : String, collection : String | Nil, operation : String | Nil, host : String | Nil, port_path_or_id : String | Nil, database_name : String | Nil, query : String | Nil)
#
def self.new(transaction : Transaction, uri : String, procedure : String | Nil, library : String | Nil)
#
Instance Method Detail
def destroy!
#
Destroy the underlying resources that were allocated for this object.
This must be called before this object goes out of scope to avoid memory
leaks from resources that have not been freed. Use the block form of the
segment support (NewRelic::Transaction.segment()
) to ensure that these
resources are freed.
def pointer : Pointer(NewRelicExt::SegmentT)
#
Return a pointer to the C structure that corresponds to the Segment.