Class: StatsD::Instrument::AggregationKey

Inherits:
Object
  • Object
show all
Defined in:
lib/statsd/instrument/aggregator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, tags, no_prefix, type, sample_rate: 1.0)
  @name = name
  @tags = tags
  @no_prefix = no_prefix
  @type = type
  @sample_rate = sample_rate
  @hash = [@name, @tags, @no_prefix, @type].hash
end

Instance Attribute Details

#hashObject (readonly)

Returns the value of attribute hash.



6
7
8
# File 'lib/statsd/instrument/aggregator.rb', line 6

def hash
  @hash
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/statsd/instrument/aggregator.rb', line 6

def name
  @name
end

#no_prefixObject (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_rateObject (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

#tagsObject (readonly)

Returns the value of attribute tags.



6
7
8
# File 'lib/statsd/instrument/aggregator.rb', line 6

def tags
  @tags
end

#typeObject (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.tags &&
    @no_prefix == other.no_prefix &&
    @type == other.type
end