Class: HeimdallApm::MetricName
- Inherits:
-
Object
- Object
- HeimdallApm::MetricName
- Defined in:
- lib/heimdall_apm/metric_name.rb
Overview
Metric name used in visitor’s metrics hash
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #hash ⇒ Object
-
#initialize(type, name, scope = nil) ⇒ MetricName
constructor
A new instance of MetricName.
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/heimdall_apm/metric_name.rb', line 5 def name @name end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
5 6 7 |
# File 'lib/heimdall_apm/metric_name.rb', line 5 def scope @scope end |
#type ⇒ Object (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
#hash ⇒ Object
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 |