Class: StatsD::Instrument::AggregationKey
- Inherits:
-
Object
- Object
- StatsD::Instrument::AggregationKey
- Defined in:
- lib/statsd/instrument/aggregator.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#no_prefix ⇒ Object
readonly
Returns the value of attribute no_prefix.
-
#sample_rate ⇒ Object
readonly
Returns the value of attribute sample_rate.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
-
#initialize(name, tags, no_prefix, type, sample_rate: 1.0) ⇒ AggregationKey
constructor
A new instance of AggregationKey.
Constructor Details
#initialize(name, tags, no_prefix, type, sample_rate: 1.0) ⇒ AggregationKey
Returns a new instance of AggregationKey.
8 9 10 11 12 13 14 15 |
# File 'lib/statsd/instrument/aggregator.rb', line 8 def initialize(name, , no_prefix, type, sample_rate: 1.0) @name = name @tags = @no_prefix = no_prefix @type = type @sample_rate = sample_rate @hash = [@name, @tags, @no_prefix, @type].hash end |
Instance Attribute Details
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
6 7 8 |
# File 'lib/statsd/instrument/aggregator.rb', line 6 def hash @hash end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/statsd/instrument/aggregator.rb', line 6 def name @name end |
#no_prefix ⇒ Object (readonly)
Returns the value of attribute no_prefix.
6 7 8 |
# File 'lib/statsd/instrument/aggregator.rb', line 6 def no_prefix @no_prefix end |
#sample_rate ⇒ Object (readonly)
Returns the value of attribute sample_rate.
6 7 8 |
# File 'lib/statsd/instrument/aggregator.rb', line 6 def sample_rate @sample_rate end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
6 7 8 |
# File 'lib/statsd/instrument/aggregator.rb', line 6 def @tags end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/statsd/instrument/aggregator.rb', line 6 def type @type end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
17 18 19 20 21 22 23 |
# File 'lib/statsd/instrument/aggregator.rb', line 17 def ==(other) other.is_a?(self.class) && @name == other.name && @tags == other. && @no_prefix == other.no_prefix && @type == other.type end |