Sha256: d467eea84b90ca2ba3b6e097f06c33346dbdc35bd9eb6d0ad97244272324f41a

Contents?: true

Size: 1.27 KB

Versions: 66

Compression:

Stored size: 1.27 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.

require 'new_relic/metric_parser'
module NewRelic
  module MetricParser
    class External < NewRelic::MetricParser::MetricParser

      def all?
        host == 'all' || host == 'allWeb' || host == 'allOther'
      end
      def hosts_all?
        library == 'all'
      end
      def host
        segments[1]
      end
      def library
        segments[2]
      end
      def operation
        segments[3] && segments[3..-1].join("/")
      end
      def legend_name
        case
        when all?
          "External Services"
        when hosts_all?
          "All #{host} calls"
        else
          developer_name
        end
      end
      def tooltip_name
        case
        when all?
          "calls to external systems"
        when hosts_all?
          "calls to #{host}"
        else
          "calls to #{developer_name}"
        end
      end
      def developer_name
        case
        when all?
          'All External'
        when hosts_all?
          host
        when operation
          "#{library}[#{host}]: #{operation}"
        else
          "#{library}[#{host}]"
        end
      end
    end
  end
end

Version data entries

66 entries across 66 versions & 2 rubygems

Version Path
newrelic_rpm-3.6.1.87 vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/external.rb
newrelic_rpm-3.6.1.86.beta vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/external.rb
newrelic_rpm-3.6.1.85.beta vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/external.rb
newrelic_rpm-3.6.0.83 vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/external.rb
newrelic_rpm-3.6.0.78 vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/external.rb
newrelic_rpm-3.6.0.74.beta vendor/gems/metric_parser-0.1.0.pre1/lib/new_relic/metric_parser/external.rb