Sha256: 7d563587b8bea50b1ed01e30172bb8ceb80d3c4138b28909feeff88217d7dbbb

Contents?: true

Size: 518 Bytes

Versions: 3

Compression:

Stored size: 518 Bytes

Contents

module NewRelic
  module Binding
    class Component
      attr_reader :name, :guid
      attr_accessor :last_delivered_at

      def initialize(name, guid)
        @name = name
        @guid = guid
        @last_delivered_at = nil
      end

      def key
        return (name + guid)
      end

      def duration
        if last_delivered_at.nil?
          return NewRelic::Binding::Config.poll_cycle_period
        else
          return (Time.now - last_delivered_at).ceil
        end
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
newrelic_plugin-1.3.1 lib/newrelic_platform_binding/component.rb
newrelic_plugin-1.3.0 lib/newrelic_platform_binding/component.rb
newrelic_plugin-1.2.1 lib/newrelic_platform_binding/component.rb