Class: HeimdallApm::MetricName

Inherits:
Object
  • Object
show all
Defined in:
lib/heimdall_apm/metric_name.rb

Overview

Metric name used in visitor’s metrics hash

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, name, scope = nil) ⇒ MetricName

Returns a new instance of MetricName.



7
8
9
10
11
# File 'lib/heimdall_apm/metric_name.rb', line 7

def initialize(type, name, scope = nil)
  @type   = type
  @name   = name
  @scope  = scope
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/heimdall_apm/metric_name.rb', line 5

def name
  @name
end

#scopeObject (readonly)

Returns the value of attribute scope.



5
6
7
# File 'lib/heimdall_apm/metric_name.rb', line 5

def scope
  @scope
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/heimdall_apm/metric_name.rb', line 5

def type
  @type
end

Instance Method Details

#hashObject



13
14
15
16
17
# File 'lib/heimdall_apm/metric_name.rb', line 13

def hash
  h = type.hash ^ name.hash
  h ^= scope.hash if scope
  h
end