Class: LitmusPaper::Metric::BigBrotherService
- Inherits:
-
Object
- Object
- LitmusPaper::Metric::BigBrotherService
- Defined in:
- lib/litmus_paper/metric/big_brother_service.rb
Instance Method Summary collapse
- #current_health ⇒ Object
-
#initialize(service) ⇒ BigBrotherService
constructor
A new instance of BigBrotherService.
- #to_s ⇒ Object
Constructor Details
#initialize(service) ⇒ BigBrotherService
Returns a new instance of BigBrotherService.
4 5 6 |
# File 'lib/litmus_paper/metric/big_brother_service.rb', line 4 def initialize(service) @service = service end |
Instance Method Details
#current_health ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/litmus_paper/metric/big_brother_service.rb', line 8 def current_health status = Net::HTTP.get('127.0.0.1', "/cluster/#{@service}", 9292) if status =~ /CombinedWeight: (\d+)/m $1.to_i else 0 end end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/litmus_paper/metric/big_brother_service.rb', line 17 def to_s "Metric::BigBrotherService(#{@service})" end |