Class: NewRelic::MetricParser::OtherTransaction

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

Overview

OtherTransaction metrics must have at least three segments: /OtherTransaction/<task>/* Task is “Background”, “Resque”, “DelayedJob” etc.

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?, #last_segment, #legend_name, #method_missing, parse, #pie_chart_label, #segment_0, #segment_1, #segment_2, #segment_3, #segment_4, #segment_5, #segments, #tooltip_name, #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



13
14
15
# File 'lib/new_relic/metric_parser/other_transaction.rb', line 13

def developer_name
  segments[2..-1].join(NewRelic::MetricParser::SEPARATOR)
end

#drilldown_url(metric_id) ⇒ Object



21
22
23
# File 'lib/new_relic/metric_parser/other_transaction.rb', line 21

def drilldown_url(metric_id)
  {:controller => '/v2/background_tasks', :action => 'index', :task => task, :anchor => "id=#{metric_id}"}
end

#is_transaction?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/new_relic/metric_parser/other_transaction.rb', line 6

def is_transaction?
  true
end

#pathObject



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

def path
  segments[2..-1].join "/"
end

#short_nameObject



17
18
19
# File 'lib/new_relic/metric_parser/other_transaction.rb', line 17

def short_name
  developer_name
end

#summary_metricsObject



29
30
31
32
33
34
35
# File 'lib/new_relic/metric_parser/other_transaction.rb', line 29

def summary_metrics
  if segments.size > 2
    %W[OtherTransaction/#{task}/all OtherTransaction/all]
  else
    []
  end
end

#taskObject



9
10
11
# File 'lib/new_relic/metric_parser/other_transaction.rb', line 9

def task
  segments[1]
end