Sha256: a816123e53535cf2dafa02c08122fab592eb5e36b972cebaef99388f422021a7

Contents?: true

Size: 1.03 KB

Versions: 73

Compression:

Stored size: 1.03 KB

Contents

# encoding: utf-8
# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.

class NewRelic::MetricParser::Client < NewRelic::MetricParser::MetricParser

  def measure
    segments[1]
  end

  def frontend?; measure == 'frontend'; end
  def backend?; measure == 'backend'; end
  def totaltime?; measure == 'totaltime'; end

  def all?
    segments[1].index('all') == 0
  end

  def operation
    all? ? 'All Operations' : segments[1].titleize.gsub(/(load|ready|time|end)$/,' \1')
  end

  def legend_name
    if frontend?
      "Browser Rendering and Asset Download"
    elsif backend?
      "Backend and Network"
    else
      segments[1..-1].join(" ")
    end
  end

  def platform
    segments[2]
  end

  def user_agent
    segments[3..-1].join(" ")
  end

  def platform_and_user_agent
    segments[2..-1].join(" ")
  end

  def developer_name
    name = segments[1].capitalize
    name << " (#{segments[2..-1].join(" ")})" if segments.length > 2
    name
  end
end

Version data entries

73 entries across 73 versions & 2 rubygems

Version Path
newrelic_rpm-3.6.3.106 vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/client.rb
newrelic_rpm-3.6.3.105.beta vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/client.rb
newrelic_rpm-3.6.3.104 vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/client.rb
newrelic_rpm-3.6.3.103.beta vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/client.rb
newrelic_rpm-3.6.2.96 vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/client.rb
newrelic_rpm-3.6.2.90.beta vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/client.rb
newrelic_rpm-3.6.1.88 vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/client.rb
newrelic_rpm-3.6.1.87 vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/client.rb
newrelic_rpm-3.6.1.86.beta vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/client.rb
newrelic_rpm-3.6.1.85.beta vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/client.rb
newrelic_rpm-3.6.0.83 vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/client.rb
newrelic_rpm-3.6.0.78 vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/client.rb
newrelic_rpm-3.6.0.74.beta vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/client.rb