Sha256: 5fe3799e25f736c9d32c02419ad2b313e58e5e7b13cec50c6f9e1f7172e7a74c

Contents?: true

Size: 657 Bytes

Versions: 17

Compression:

Stored size: 657 Bytes

Contents

# encoding: utf-8
require "logstash/event"
require "logstash/util"

module LogStash module Instrument module MetricType
  class Base
    attr_reader :namespaces, :key

    def initialize(namespaces, key)
      @namespaces = namespaces
      @key = key
    end

    def inspect
      "#{self.class.name} - namespaces: #{namespaces} key: #{key} value: #{value}"
    end

    def to_hash
      {
        "namespaces" => namespaces,
        "key" => key,
        "type" => type,
        "value" => value
      }
    end

    def to_json_data
      value
    end

    def type
      @type ||= LogStash::Util.class_name(self).downcase
    end
  end
end; end; end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
logstash-core-5.0.0.alpha4.snapshot3-java lib/logstash/instrument/metric_type/base.rb
logstash-core-5.0.0.alpha4.snapshot2-java lib/logstash/instrument/metric_type/base.rb
logstash-core-5.0.0.alpha4.snapshot1-java lib/logstash/instrument/metric_type/base.rb
logstash-core-5.0.0.alpha3-java lib/logstash/instrument/metric_type/base.rb
logstash-core-5.0.0.alpha3.snapshot8-java lib/logstash/instrument/metric_type/base.rb
logstash-core-5.0.0.alpha3.snapshot7-java lib/logstash/instrument/metric_type/base.rb
logstash-core-5.0.0.alpha3.snapshot6-java lib/logstash/instrument/metric_type/base.rb
logstash-core-5.0.0.alpha3.snapshot5-java lib/logstash/instrument/metric_type/base.rb
logstash-core-5.0.0.alpha3.snapshot4-java lib/logstash/instrument/metric_type/base.rb
logstash-core-5.0.0.alpha3.snapshot2-java lib/logstash/instrument/metric_type/base.rb
logstash-core-5.0.0.alpha3.snapshot1-java lib/logstash/instrument/metric_type/base.rb
logstash-core-5.0.0.alpha2-java lib/logstash/instrument/metric_type/base.rb
logstash-core-5.0.0.alpha2.snapshot2-java lib/logstash/instrument/metric_type/base.rb
logstash-core-5.0.0.alpha2.snapshot1-java lib/logstash/instrument/metric_type/base.rb
logstash-core-5.0.0.alpha1-java lib/logstash/instrument/metric_type/base.rb
logstash-core-5.0.0.alpha1.snapshot2-java lib/logstash/instrument/metric_type/base.rb
logstash-core-5.0.0.alpha1.snapshot1-java lib/logstash/instrument/metric_type/base.rb