Class: Remon::Metrics::Consul
- Inherits:
-
Object
- Object
- Remon::Metrics::Consul
- Defined in:
- lib/remon/metrics/consul.rb
Instance Method Summary collapse
- #failed_nodes ⇒ Object
-
#initialize(host: "127.0.0.1", port: 8500) ⇒ Consul
constructor
A new instance of Consul.
Constructor Details
#initialize(host: "127.0.0.1", port: 8500) ⇒ Consul
Returns a new instance of Consul.
8 9 10 11 |
# File 'lib/remon/metrics/consul.rb', line 8 def initialize(host: "127.0.0.1", port: 8500) @host = host @port = port end |
Instance Method Details
#failed_nodes ⇒ Object
13 14 15 16 17 18 |
# File 'lib/remon/metrics/consul.rb', line 13 def failed_nodes nodes = {} failed_serf_checks = critical_checks.select { |i| i["CheckID"] == "serfHealth" } failed_serf_checks.each { |i| nodes[i["Node"]] = i["Output"] } nodes end |