Method: NewRelic::Agent::Transaction::DatastoreSegment#initialize

Defined in:
lib/new_relic/agent/transaction/datastore_segment.rb

#initialize(product, operation, collection = nil, host = nil, port_path_or_id = nil, database_name = nil, start_time = nil) ⇒ DatastoreSegment

Returns a new instance of DatastoreSegment.

[View source]

19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/new_relic/agent/transaction/datastore_segment.rb', line 19

def initialize(product, operation, collection = nil, host = nil, port_path_or_id = nil, database_name = nil, start_time = nil)
  @product = product
  @operation = operation
  @collection = collection
  @sql_statement = nil
  @nosql_statement = nil
  @record_sql = true
  set_instance_info(host, port_path_or_id)
  @database_name = database_name&.to_s
  super(Datastores::MetricHelper.scoped_metric_for(product, operation, collection),
        nil,
        start_time)
end