Sha256: ac91c8a6e90d224237dd409741f435308e0b9ff7d98ef7c011cc281618238509

Contents?: true

Size: 593 Bytes

Versions: 12

Compression:

Stored size: 593 Bytes

Contents

module NewRelic
  class MetricData
    attr_accessor :metric_spec
    attr_accessor :metric_id
    attr_accessor :stats
    
    def initialize(metric_spec, stats, metric_id)
      self.metric_spec = metric_spec
      self.stats = stats
      self.metric_id = metric_id
    end
    
    def eql?(o)
     (metric_spec.eql? o.metric_spec) && (stats.eql? o.stats)
    end
    
    def hash
      metric_spec.hash + stats.hash
    end
    
    def to_s
      "#{metric_spec.name}(#{metric_spec.scope}): #{stats}" if metric_spec
      "#{metric_id}: #{stats}" if metric_spec.nil?
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
newrelic_rpm-2.8.0 lib/new_relic/metric_data.rb
newrelic_rpm-2.8.1 lib/new_relic/metric_data.rb
newrelic_rpm-2.8.10 lib/new_relic/metric_data.rb
newrelic_rpm-2.8.11 lib/new_relic/metric_data.rb
newrelic_rpm-2.8.2 lib/new_relic/metric_data.rb
newrelic_rpm-2.8.3 lib/new_relic/metric_data.rb
newrelic_rpm-2.8.4 lib/new_relic/metric_data.rb
newrelic_rpm-2.8.5 lib/new_relic/metric_data.rb
newrelic_rpm-2.8.6 lib/new_relic/metric_data.rb
newrelic_rpm-2.8.7 lib/new_relic/metric_data.rb
newrelic_rpm-2.8.8 lib/new_relic/metric_data.rb
newrelic_rpm-2.8.9 lib/new_relic/metric_data.rb