Class: HystrixMetrics::Metric
- Inherits:
-
HystrixCommand
- Object
- HystrixCommand
- HystrixMetrics::Metric
- Defined in:
- lib/hystrix_metrics/metric.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
Instance Method Summary collapse
-
#initialize(name, work, group = "Default") ⇒ Metric
constructor
A new instance of Metric.
- #run ⇒ Object
Constructor Details
#initialize(name, work, group = "Default") ⇒ Metric
Returns a new instance of Metric.
12 13 14 15 16 17 |
# File 'lib/hystrix_metrics/metric.rb', line 12 def initialize(name, work, group="Default") @work = work super(HystrixCommand::Setter .withGroupKey(HystrixCommandGroupKey::Factory.asKey(group)) .andCommandKey(HystrixCommandKey::Factory.asKey(name))) end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
10 11 12 |
# File 'lib/hystrix_metrics/metric.rb', line 10 def command @command end |
Instance Method Details
#run ⇒ Object
19 20 21 |
# File 'lib/hystrix_metrics/metric.rb', line 19 def run @work.call end |