Class: LogStash::Instrument::MetricType::Base
- Inherits:
-
Object
- Object
- LogStash::Instrument::MetricType::Base
- Defined in:
- lib/logstash/instrument/metric_type/base.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#namespaces ⇒ Object
readonly
Returns the value of attribute namespaces.
Instance Method Summary collapse
-
#initialize(namespaces, key) ⇒ Base
constructor
A new instance of Base.
- #inspect ⇒ Object
- #to_hash ⇒ Object
- #to_json_data ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(namespaces, key) ⇒ Base
Returns a new instance of Base.
8 9 10 11 |
# File 'lib/logstash/instrument/metric_type/base.rb', line 8 def initialize(namespaces, key) @namespaces = namespaces @key = key end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
6 7 8 |
# File 'lib/logstash/instrument/metric_type/base.rb', line 6 def key @key end |
#namespaces ⇒ Object (readonly)
Returns the value of attribute namespaces.
6 7 8 |
# File 'lib/logstash/instrument/metric_type/base.rb', line 6 def namespaces @namespaces end |
Instance Method Details
#inspect ⇒ Object
13 14 15 |
# File 'lib/logstash/instrument/metric_type/base.rb', line 13 def inspect "#{self.class.name} - namespaces: #{namespaces} key: #{key} value: #{value}" end |
#to_hash ⇒ Object
17 18 19 20 21 |
# File 'lib/logstash/instrument/metric_type/base.rb', line 17 def to_hash { key => value } end |
#to_json_data ⇒ Object
23 24 25 |
# File 'lib/logstash/instrument/metric_type/base.rb', line 23 def to_json_data value end |
#type ⇒ Object
27 28 29 |
# File 'lib/logstash/instrument/metric_type/base.rb', line 27 def type @type ||= LogStash::Util.class_name(self).downcase end |