Class: NewRelic::MetricParser::ActiveRecord

Inherits:
NewRelic::MetricParser show all
Defined in:
lib/new_relic/metric_parser/active_record.rb

Constant Summary

Constants inherited from NewRelic::MetricParser

SEPARATOR

Instance Attribute Summary

Attributes inherited from NewRelic::MetricParser

#name

Instance Method Summary collapse

Methods inherited from NewRelic::MetricParser

#apdex_metric_path, #base_metric_name, #call_rate_suffix, #category, for_metric_named, #initialize, #is_controller?, #is_transaction?, #last_segment, #method_missing, parse, #pie_chart_label, #segment_0, #segment_1, #segment_2, #segment_3, #segment_4, #segment_5, #segments, #short_name, #summary_metrics, #url

Constructor Details

This class inherits a constructor from NewRelic::MetricParser

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NewRelic::MetricParser

Instance Method Details

#developer_nameObject



25
26
27
# File 'lib/new_relic/metric_parser/active_record.rb', line 25

def developer_name
  "#{model_class}##{segments.last}"
end

#is_active_record?Boolean

Returns:

  • (Boolean)


2
# File 'lib/new_relic/metric_parser/active_record.rb', line 2

def is_active_record? ; true; end

#is_database?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/new_relic/metric_parser/active_record.rb', line 8

def is_database?
  true
end

#legend_nameObject



11
12
13
14
15
16
17
# File 'lib/new_relic/metric_parser/active_record.rb', line 11

def legend_name
  if name == 'ActiveRecord/all'
    'Database'
  else
    super
  end
end

#model_classObject



4
5
6
# File 'lib/new_relic/metric_parser/active_record.rb', line 4

def model_class
  return segments[1]
end

#tooltip_nameObject



18
19
20
21
22
23
24
# File 'lib/new_relic/metric_parser/active_record.rb', line 18

def tooltip_name
  if name == 'ActiveRecord/all'
    'all SQL execution'
  else
    super
  end
end